首先感谢集美大学蔡莉白老师发现这个问题并与我沟通交流,我在蔡老师提供的代码基础上又稍作扩展和补充。...: 'int' object is not iterable
结果证明,+=和append()的用法还是有区别的。...>> x
['a', 'b', 1, 2, 1, 2, 1, 2, 0, 1, 2, '0', '1', '2']
使用+=运算符居然能把列表和元组、集合、字典甚至map对象、range对象里的元素连接到一起...):
File "", line 1, in
x = x + {1, 2, 3}
TypeError: can only concatenate list...>", line 1, in
x = x + {1:'a', 2:'b'}
TypeError: can only concatenate list (not "dict")