元素
导入当前列表
中list.extend(iterable)
iterable
代表列表或元组 , 该函数无返回值iterable
iterable
就不行)字典
的话只会保留key
的值# coding:utf-8
manhua = []
history = []
code = []
new_manhua = ('a', 'b', 'c')
new_history = ('中国历史', '日本历史', '韩国历史')
new_code = ('python', 'django', 'flask')
manhua.extend(new_manhua)
history.extend(new_history)
code.extend(new_code)
print(manhua, history, code)
history.extend(manhua)
del manhua
print(history)
test = []
# test.extend('abcd')
test.extend({'name': 'dewei', 'age': 33})
# test.extend(True)
print(test)