How to create a dictionary using multiple variables in Python

1 Answer

0 votes
dic = dict(a=10, b=20, c=30, d=40)

print(dic)

 
 
 
 
'''
run:
  
{'a': 10, 'b': 20, 'c': 30, 'd': 40}

'''

 



answered Feb 24, 2023 by avibootz

Related questions

1 answer 114 views
1 answer 113 views
1 answer 126 views
2 answers 150 views
...