1answer.
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]
4 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]4 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
Describe the steps which should be taken after a cyber-attack has taken place
Dovator [93]

Answer:

1. Contain the Breach

2. Assess the Breach

3. Manage the Fallout

Explanation:

5 0
3 years ago
Generally speaking, what is a “best practice"?
miss Akunina [59]

Answer:

What’s up, I’m currently in this class, and I was wondering if it’s easy or hard?

Explanation:

3 0
3 years ago
Computers store all characters as numbers stored as binary data. Each instruction or symbol gets a bit string assignment. The st
juin [17]

Answer:

0 and 1

Explanation:

Please mark brainliest

7 0
3 years ago
A(n) ________ is a server-based operating system oriented to computer networking and may include directory services, network man
Ganezh [65]

Answer:

Network Operating System (NOS)

Explanation:

A network operating system (NOS) is an operating system that makes different computer devices connect to a common network in order to communicate and share resources with each other using a server. A network operating system can be used by printers, computers, file sever among others, and they are connected together using a local area network. This local area network which they are connected to works as the server.

The NOS also acts as a network security because it could be used as an access control or even user authentication.

There are two types of NOS

1) Peer to peer network operating system.

2) Client/server network operating system

A network operating system (NOS) is a server-based operating system oriented to computer networking and may include directory services, network management, network monitoring, network policies, user group management, network security, and other network-related functions.

4 0
3 years ago
What size hard disc is recommended for powerpoint writting
mixas84 [53]

Answer:

Depends on how many PowerPoint files you want to store and how long they are. I'd recommend at least a 256GB hard drive to store your OS and software and then leave space for PowerPoints.

5 0
3 years ago
Other questions:
  • How to change default search engine in internet explorer 11?
    13·1 answer
  • Which language is the most popular language for writing apple os x?
    9·1 answer
  • What is the simple way to permanently get rid of an unwanted file
    14·1 answer
  • A computer has the following parameters Operation Frequency Cycles Arithmetic/Logical instructions 65% 1 Register load operation
    11·1 answer
  • An attacker compromises the Washington Post's web server and proceeds to modify the homepage slightly by inserting a 1x1 pixel i
    12·1 answer
  • WILL MARK BRAINIEST
    12·1 answer
  • A simulation system is a technology that enables you to take over a customer’s screen, mouse, or other connected device in order
    13·1 answer
  • Write a program that reads a book (a file in text format), breaks each line into words, strips whitespace and punctuation from t
    10·1 answer
  • What is an infodemic?
    10·1 answer
  • Edhesive assignment 7 calendar
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!