+
#字符串
str1 = 'aa'
str2 = 'bb'
#列表
list1 = [1, 2]
list2 = [10, 20]
#元组
t1 = (1, 2)
t2 = (10, 20)
#字典
dict1 = {'name': 'Python'}
dict2 = {'age': 30}
# +: 合并
print(str1 + str2)
print(list1 + list2)
print(t1 + t2)
# print(dict1 + dict2) # 报错:字典不支持合并运算
*
# 1. 字符串串
print('-' * 10) # ---------
# 2. 列列表
list1 = ['hello']
print(list1 * 4) # ['hello', 'hello', 'hello', 'hello']
# 3. 元组
t1 = ('world',)
print(t1 * 4) # ('world', 'world', 'world', 'world')
in或not in
# 1. 字符串
print('a' in 'abcd') # True
print('a' not in 'abcd') # False
# 2. 列表
list1 = ['a', 'b', 'c', 'd']
print('a' in list1) # True
print('a' not in list1) # False
# 3. 元组
t1 = ('a', 'b', 'c', 'd')
print('aa' in t1) # False
print('aa' not in t1) # True