Sunday, February 8, 2026

 Python

Dictionary 

Dictionaries are used to store data values in key:value pairs.

#Dictionary
Countries = {"Asia":("India","China", "Pakistan", "Thailand"), "Europe":["Germany","Italy"]}
print(Countries)
print(Countries["Asia"])
print(Countries["Europe"])

Output
{'Asia': ('India', 'China', 'Pakistan', 'Thailand'), 'Europe': ['Germany', 'Italy']}
('India', 'China', 'Pakistan', 'Thailand')
['Germany', 'Italy']

No comments:

Post a Comment

Python Passing arguments through function using args and kwargs args take non keyworded arguments, while kwargs take keyworded arguments. de...