Afiz
Data Types in Python
1. Numbers
2. Strings
3. List
4. Tuple
5. Set
6. Dictionary
# define a dictionary called student
student = {'name': 'Afiz', 'city': 'Banglore'}
# accesing items: key is used to access items
print(student['name']) # 'Afiz'
# Adding a new item
student['country'] = 'India'
# if the country already exists,it
student['city'] = 'Hyderabad'
With Code Snippets 🤩
# define a dictionary called student
student = {'name': 'Afiz', 'city': 'Banglore'}
# accesing items: key is used to access items
print(student['name']) # 'Afiz'
# Adding a new item
student['country'] = 'India'
# if the country already exists,it
student['city'] = 'Hyderabad'