#print every state abbreviation
print("-" * 10)
for state, abbrev in list(states.items()):
print(f"{state} is abbreviated {abbrev}")
#print every state abbreviation
print("-" * 10)
for abbrev, city in list(cities.items()):
print(f"{states} has the city {city}")
#now do both at the same time
print("-" * 10)
for state, abbrev in list(states.items()):
print(f"{state} state is abbreviated {abbrev}")
print(f"and has city {city}")
THIS PART OF THE CODE, WHERE ABBREV IS NOT MENTIONED EARLIER AND USED HERE,I AM NOT ABLE TO UNDERSTAND.
so in this code if i am not wrong the for line in which abbrev was used the first time was:
abbrev = states.items()
and items is a func to access the items in the dict data structure
have i understood it correctly?
thankyou for the reply @ulfen69