+ 3

Plz someone explain last for loop

primary = { "red": [255, 0, 0], "green": [0, 255, 0], "blue": [0, 0, 255], } for i in primary: print(i) print('\n') for i in primary: print(primary[i]) print('\n') for i in primary: print(i,primary[i]) print('\n') for i,j in primary.items(): print(i,j[0],j[1],j[2]) Output : red green blue [255, 0, 0] [0, 255, 0] [0, 0, 255] red [255, 0, 0] green [0, 255, 0] blue [0, 0, 255] red 255 0 0 green 0 255 0 blue 0 0 255

17th Mar 2020, 8:31 AM
Shailja Khare
2 odpowiedzi
+ 4
Got it thnku
17th Mar 2020, 8:48 AM
Shailja Khare