answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Murljashka [212]
2 years ago
13

Delete Prussia from country_capital. Sample output with input: 'Spain:Madrid,Togo:Lome,Prussia: Konigsberg' Prussia deleted? Yes

. Spain deleted? No. Togo deleted? No.
Computers and Technology
1 answer:
7nadin3 [17]2 years ago
3 0

Answer:

Explanation:

When deleting anything from dictionary always mention the key value in quotes .

Ex: 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 defined.

Code:

user_input=input("") #taking input from user

entries=user_input.split(',')    

country_capital=dict(pair.split(':') for pair in entries) #making the input as dictionary

del country_capital['Prussia'] #deleting Prussia here if we don't mention the value in quotes it will give error

print('Prussia deleted?', end=' ')

if 'Prussia' in country_capital: #checking Prussia is in country_capital or not

print('No.')

else:

print('Yes.')

print ('Spain deleted?', end=' ')    

if 'Spain' in country_capital: #check Spain is in Country_capital or not

print('No.')

else:

print('Yes.')

print ('Togo deleted?', end=' ') #checking Togo is in country_capital or not

if 'Togo' in country_capital:

print('No.')

else:

print('Yes.')

Explanation:

You might be interested in
in a blank excel workbook go to insert tab on the ribbon, which of the following is Not vailable 1 smart art 2 coloumns ( not co
Anuta_ua [19.1K]

Answer:

  1. hahahahahahahhahah
7 0
2 years ago
5.11 Of these two types of programs:a. I/O-boundb. CPU-boundwhich is more likely to have voluntary context switches, and which i
Leno4ka [110]

Answer:

The answer is "both voluntary and non-voluntary context switch".

Explanation:

The description to this question can be described as follows:

Whenever processing requires resource for participant contextual switch, it is used if it is more in the situation of I/O tied. In which semi-voluntary background change can be used when time slice ends or even when processes of greater priority enter.

  • In option a, It requires voluntary context switches in I /O bound.
  • In option b, it requires a non-voluntary context switch for CPU bound.
7 0
2 years ago
A workgroup database is a(n) _____ database
Step2247 [10]
It is a shared database
8 0
2 years ago
Which of the following connects the processor to the chipset and memory on the motherboard? a. Thread b. FSB c. BIOS d. ALU
IRISSAK [1]

Answer:

The correct Answer is (b) FSB

Explanation:

The chipset is the "superglue" that bonds the microprocessor to the rest of the motherboard and so to the rest of the computer. On a computer, it consists of two basic parts -- the Northbridge and the southbridge. All of the numerous modules of the computer communicate with the CPU over the chipset.

The northbridge joins straight to the processor via the front side bus (FSB). A memory controller is situated on the northbridge, which gives the CPU fast access to the memory. The northbridge also attaches to the AGP or PCI Express bus and to the memory himself.

3 0
2 years ago
For drivers under 21, the penalties for driving with an illegal BAL include _____.
JulijaS [17]
Up to one year In jail
5 0
2 years ago
Read 2 more answers
Other questions:
  • The tuna marketers' task in the "tunathewonderfish.com" website and related campaign was to ________.
    15·1 answer
  • Is used to process certificates and private/public key information?
    12·1 answer
  • A mistake programmers often make with loops is that they ____.
    15·1 answer
  • Does the Boolean expression count > 0 and total / count > 0 contain a potential error? If so, what is it?
    8·1 answer
  • "Suppose there is a class Alarm. Alarm has two class variables, code which contains a String value representing the code that de
    10·1 answer
  • Given an alphabet, print all the alphabets up to and including the given alphabet.
    15·2 answers
  • Consider two vectors that are NOT sorted, each containing n comparable items. How long would it take to display all items (in an
    8·1 answer
  • In cell M2, enter a formula using a nested IF function as follows to determine first if a student has already been elected to of
    12·1 answer
  • What is the value of the variable result after these lines of code are executed?
    5·2 answers
  • In this first journal assignment, you will explore the role of testing in the SDLC. You will explain the role and importance of
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!