0
How to print a dictionary like {a: 1, b:4, c:9, d:16, e:25} using for loop?
Using loop can we create and print this series of dictionary - {a:1,b:4,c:9,d:25,e:36,f:49....}
4 Answers
+ 3
With str(chr(97)) you create an a.
str(chr(98)) = "b"
This might help you. :)
+ 2
Do you have some code where you tried it but got stuck?
Otherwise its hard to help you.
Just giving you the answer wont help you to become a programmer.
0
Here is the code that is like {1:1,2:4,3:9,4:16,5:25.....n:nÂČ}
But if we want to change the key part in alphabetical order. For that can we generate generate the series like {a:1,b:4,c:9,d:16......}
https://code.sololearn.com/ctbOCDr2Y5Kv/?ref=app
0
Yes, thank you, will learn about it and implement it on my code.