+ 1
Printing dictionary using for loops
I'm wanting to print the value first followed by the key using for loops. Currently in school started my CS class
2 Answers
+ 1
dict = {1: "one", 2: "two"}
for key in dict:
print(dict[key], key)
+ 1
Thanks! I just got around to it and it worked great.