# ==============输入输出================================
a = [1, 2, 3, 4]
print(a)
A = ''.join(map(str, a)) # join后面的必须放字符串列表
print(A)
# while True:
# try:
# pass
# except:
# break
print("%.2f" % 0.13333)
# 输入一个字典
# M = [[0 for _ in range(4)] for _ in range(3)] # 3行4列
# n = 3
# for i in range(n):
# M[i] = list(map(int, input().split()))
# ====================列表的操作=========================
y = [1, 2, 3, 4, 5, 6, 7, 8, 9]
b = y.index(4) # 取特定值的索引
# print(b)
del y[3] # 删除列表中的某个值
# print(y)
y.remove(2) # 删除指定元素
# print(y)
y.reverse() # 翻转列表
# print(y)
n = y.count(9) # 计数
# ====================字典的操作========================
dict = {'Alice': '2341', 'Beth': '9102', 'Cecil': '3258'}
t1 = dict.items() # 取字典中的元素
t2 = dict.keys() # 取键
t3 = dict.values() # 取值
# print(t1)
# print(t2)
# print(t3)
t4 = dict.get('Alice') #根据键取键值
# print(t4)
print(dict.__contains__('Alice')) # 判断键是否在字典中
# del dict['Alice'] # 删除字典中的元素
# print(dict)
# dict.pop('Beth') # 删除字典中的元素
# print(dict)
a = {'f':6,'b':4,'c':1}
b = max(a) # 取最大的键
c = sorted(a) # 对键进行排列
print('a+++',b, c)
# =========================字符串的操作====================
a = 'aabbccddeeff'
a = a.replace('aa', 'bb') # 将字符串中的某个字符替换成其他字符
# print(a)
# =====================集合(不重复)的操作=========================
a = set() # 设置一个集合
a.add(4)
print(a)