How to loop through dictionary in Python

1 Answer

0 votes
dict = {
    "name": "Tom",
    "age": 47,
    "langauge": "python", 
    "company":  "google"}
     
for key in dict:
	print(key, '-', dict[key])
 
 
 
'''
run:
 
name - Tom
age - 47
langauge - python
company - google
 
'''

 



answered Jan 12, 2021 by avibootz

Related questions

1 answer 141 views
1 answer 191 views
1 answer 191 views
1 answer 190 views
1 answer 165 views
1 answer 141 views
141 views asked May 14, 2021 by avibootz
1 answer 197 views
...