(Python) Can I iterate through a dictionary like this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

(Python) Can I iterate through a dictionary like this?

Is it the right way to iterate through a dictionary like this? squares = {1: 1, 2: 4, 3: 9, 4: 16,} for i in squares: print(i,"=", squares[i])

14th Oct 2020, 10:55 AM
Sam
Sam - avatar
1 Answer
+ 3
yes, you can insert that code into codeplaygrpumd to see for yourself
14th Oct 2020, 11:23 AM
Roderick Davis
Roderick Davis - avatar