1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| print(type([1,2,3,4,5,6])) print(type(["AA","BB",2,3,True,False]))
print(type([[1,2],[3,4]]))
print(["A","B","C"][0]) print(["A","B","C"][2]) print(["A","B","C"][0:2]) print(["A","B","C"][-1:]) print(["A","B"] * 3)
print(type((1,2,3))) print(type((1,2,False))) print((1,2,False)[2])
print(3 in [1,2,3,4,5]) print(6 in [1,2,3,4,5]) print(6 not in [1,2,3,4,5])
print(len("HELLO !"))
print(max([1,2,3,4,5])) print(min([1,2,3,4,5])) print(min("hello"))
print(ord('w')) print(ord(" "))
print({1,2,3,4,4,5}) print({1,2,3,4,5}) print({6,2,2,3,4,5})
print(len({1,2,3})) print(1 in {1,2,3}) print(1 not in {1,2,3})
print({2,3,4,5} - {5,6})
print({2,3,4,5,6} & {5,6,7,8})
print({2,3,4,5,6} | {5,6,7,8})
print(type({})) print(type(set()))
print(type({"AA":"aa", "BB":"bb"}))
print({"A":"张","B":"王","C":"李","D":"赵"}["A"])
|