Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

dictionart

def country_intro(dictionary):
    for key, val in dictionary.items():
        print(f'The name of the country is {key} and it is famous for {val}')

countries_famous = { }

while True:
    country_name = input('Enter the name of the country:')
    country_famous = input('Enter what it is famous for:')
    countries_famous[country_name] = country_famous

    country = input('Another country? (y/n)')
    if country == 'y':
        continue
    else:
        break

country_intro(countries_famous)
Comment

PREVIOUS NEXT
Code Example
Python :: pyPS4Controller usage 
Python :: azureservicebus legacy-install-failure 
Python :: 10 minutes to pandas 
Python :: await not working python 
Python :: pylance not reading django 
Python :: find the index of nanmax 
Python :: if string contains loop pandas 
Python :: python count down advanced 
Python :: Check if a Key is Already Present in a Dictionary 
Python :: Source code: Matrix Addition using Nested Loop 
Python :: how to reorder columns in pandas 
Python :: python solve rubicks cube 
Python :: _rocketcore pypi 
Python :: how to make a var in pycode 
Python :: python array_combine 
Python :: download face_cascade.detectMultiScale 
Python :: corresponding angles 
Python :: how to find left top width and height on an image using python 
Python :: pycharm shortcut to create methos 
Python :: can data scientists become software developer 
Python :: even number list generator 
Python :: Improve the Request Change User-Agent 
Python :: como utilizar activar grepper en visual studio code python 
Python :: what does math.acos do in python 
Python :: With Python, it is possible to use the ** operator to calculate powers 
Python :: Customize tick spacing 
Python :: Path 
Python :: python 2 factor authentication 
Python :: python project structure 
Python :: bold colors in pytohn 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =