#列表可以使用extend方法将两个列表合并成为一个列表
num1 = [1,2,3,4,5]
num2 = [6,7,8,9]
num1.extend(num2)
print(num1)
print(num1+num2)
word1 = ('hello','world')
word2 = ('python','java')
print(word1+word2)
person1 = {'name':'curry','hobby':'basketball'}
person2 = {'number':30,'age':32}
person1.update(person2)
print(person1)
#字典之间不支持加法运算
result
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 6, 7, 8, 9]
('hello', 'world', 'python', 'java')
{'name': 'curry', 'hobby': 'basketball', 'number': 30, 'age': 32}
Process finished with exit code 0