Lesson03

Run Settings
LanguagePython
Language Version
Run Command
LIST=[1, 3, [2, 4, 6],7] print(LIST[2]) print(LIST[2][1]) print(LIST[2][2]) LIST2=['1','3','4','5'] print(LIST2[2], type(LIST2[2])) LIST3=['1', '3', ['2', ['4', '6'], '炎', ('泳', '埋')]] print(LIST3[2][1][0]) # Find '4' LIST4=['1', '3', ['2', ['4', '6'], '炎', ('泳', '埋')]] print(LIST4[2][3][0]) # Find '泳' APPLE = {"Type" : "MAC", "Color" : "GREEN"} print(APPLE.items()) APPLE.update({"Years" : "1999"}) print(APPLE.items()) print(APPLE) APPLE["Toy"] = "bear" print(APPLE) b = [1,2,3] b.append(4) print(b) apple=[1,2,[2,3,4],[5,6,7],{"food" : "apple", "toy" : "bear"},8,9,[0,1,2]] print(apple[3][2]) # Find 7 print(apple[4]["toy"]) #Find "bear" apple=[1,2,[2,3,4],[5,6,7],{"food" : ["a", "b", "c"], "toy" : "bear"},8,9,[0,1,2]] print(apple[4]["food"][1]) #Find "b" apple=[1,2,[2,(3,4,"")],[5,6,7],{"food" : ["a", "b", "c"], "toy" : "bear"},8,9,[0,1,2]] print(apple[2][1][2]) #Find blank value apple=[1,2,[2,(3,4,"")],[5,6,7],{"food" : ("a", "b", "c"), "toy" : "bear"},8,9,[0,1,2]] print(apple[4]["food"][2]) #Find "c" a = 1, print(type(a)) b = "", print(type(b)) c = tuple() # The best to declare empty tuple value print(type(c)) apple=[1,2,[2,(3,4,"")],[5,6,7],{"food" : ["a", "b", "c"], "toy" : "bear"},8,9,[0,1,2]] print() a = {1,2,3,4,4,4,5,6,1,2} print(a) a = {10,4,3,20,8,3} print(a) a = {'a','b','a',4,4,4,5,6,1,2} print(a)
Editor Settings
Theme
Key bindings
Full width
Lines