Question: Type the program's output # New means new compared to previous level provincial_capitals = { 'Alberta': 'Edmonton', 'Ontario': 'Toronto', 'BC': 'Victoria', 'Manitoba': 'Winnipeg' } province_name
Type the program's output
# "New" means new compared to previous level provincial_capitals = { 'Alberta': 'Edmonton', 'Ontario': 'Toronto', 'BC': 'Victoria', 'Manitoba': 'Winnipeg' }
province_name = input() while province_name != 'exit': if province_name in provincial_capitals: print(provincial_capitals[province_name]) del provincial_capitals[province_name] # New line else: print('x') province_name = input()
input
BC
Alabama
BC
Alberta
exit

CHALLENGE ACTIVITY 8.12.2: Enter the output of dictionaries. Jump to level 1 Type the program's output # "New" means new compared to previous level provincial_capitals = { 'Alberta': 'Edmonton', "Ontario': 'Toronto', "BC': 'Victoria', "Manitoba': 'Winnipeg } Input BC Alabama BC Alberta exit province_name = input() while province_name != 'exit': if province_name in provincial_capitals: print (provincial_capitals (province_name]) del provincial_capitals (province_name] # New line else: print('x') province_name = input () Output 4 Check Next Feedback
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
