import sys
a = 3
b = 4
print(a + b)
a = [1, 2, 3, 4, 6]
b = [2, 5, 9]
a + b
print(a + b)
del a[3]
a.pop()
a.remove(1)
a.append(b)
print(a)
c = 1
if c in a:
print("true")
else:
print("no")
x = [1, 4, 4, 6,]
d = len(x)
m = max(x)
s = min(x)
print(d, m, s)
str1 = 'abcd'
list2 = list(str1)
list3 = str(list2)
print(list3)
item = [2, 5, 3, 1, 9]
item.sort()
print(item)
item.sort(reverse=True)
print(item)
tup1 = tuple()
tup2 = (1, 3, 4, 6, 7)
tup2[:2]
print(tup2[:2])
tup3 = (3, 8, 9)
tup4 = tup2 + tup3
print(tup4)
del tup1
dic1 = {}
dic1 = dict()
dic2 = {'name': "zhangsan", 'age': 20, 'class': 3}
print(dic2['age'])
dic2['age'] = 19
print(dic2['age'])
del dic2['name']
print(dic2)
print(dic2)
dic2.keys()
dic2.values()
dic2 = {'nam': 'hahah', 'hahah': 666, 'qita': 'hahahahah'}
dic2.update()
for key, values in dic2.items():
print(key, values)
print(dic2)
a = 1
while a < 10:
print(a)
a += 2
str5 = "hahah"
for i in str5:
print(i)
for i in range(len(str5)):
print(str5[i])
item = [[1,2], [3, 6], [4, 8], [4, 7]]
for i in item:
print(i)
for j in i:
print(j)
|