COMPSCI 1026A_B_ Computer Science Fundamentals chp11.pdf COMPSCI
Delete Prussia From Country_Capital. Web no.user_input = input ()entries = user_input.split (‘,’)country_capital = {}for pair in entries:split_pair = pair.split (‘:’)country_capital [split_pair [0]] = split_pair [1]#. Sample output for the given program:
Web delete prussia from country_capital. Web delete prussia from country_capital. When deleting anything from dictionary always mention the key value in quotes. Sample output for the given program: Web delete prussia from country_capital. Pdb.set_trace () at the location you want to break into the debugger. Web delete prussia from country_capital. Del country_capital ['prussia'] if we don't mention it in quotes it will consider that prussia as variable and gives the error prussia is not define. Web to remove the country, we will check if it exists in the dictionary. Del country_capital['prussia'] if we don't mention it in quotes it.
Web delete prussia from country_capital.sample output with input: In the function, we will pass the country name 'prussia', so it will be. Web delete prussia from country_capital. Web delete prussia from country_capital.sample output with input: When deleting anything from dictionary always mention the key value in quotes. Asked 8 years, 5 months ago. Sample output with input spain madrid,togo lome.prussia konigsberg prussia deleted? Web delete prussia from country_capital. When deleting anything from dictionary always mention the key value in quotes ex: If it exists, we will delete it using function pop. Sample output for the given program: