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
Ugo [173]
3 years ago
15

Write 3 functions in the starter code below such that: add_to_dict(): takes a dictionary, a key, a value and adds the key,value

pair to the dictionary. If key is already in dictionary then it displays the error message: "Error. Key already exists.". Returns dictionary. remove_from_dict(): takes a dictionary and key and removes the key from the dictionary. Returns dictionary. If no such key is found in the dictionary then it prints: "No such key exists in the dictionary.". Hint: Use try-except. find_key(dictt, key): takes dictionary and key and prints value corresponding to the key from the dictionary: print("Value: ", value). If key is not found, then prints: "Key not found." Hint: Use try-except
Computers and Technology
1 answer:
shepuryov [24]3 years ago
4 0

Answer:

Required code is given below:

Explanation:

def add_to_dict(dictt, key,value):

if key in dictt.keys():

print("Error. Key already exists.")

else:

dictt[key]=value

return dictt

def remove_from_dict(dictt,key):

try:

dictt[key]

dictt.pop(key, None)

return dictt

except KeyError:

print("No such key exists in the dictionary.")

def find_key(dictt,key):

try:

value=dictt[key]

print("Value: ", value)

except KeyError:

print("Key not found.")

You might be interested in
In design and implementation of any _____ reasoning application, there are 4 Rs involved: retrieve, reuse, revise, and retain.
Burka [1]

Answer:

case-based.

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer on how to perform a specific task and solve a particular problem.

Simply stated, it's a computer program or application that comprises of sets of code for performing specific tasks on the system.

A software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications. There are seven (7) main stages in the creation of a software and these are;

1. Planning.

2. Analysis.

3. Design.

4. Development (coding).

5. Testing.

6. Implementation and execution.

7. Maintenance.

A case-based reasoning application refers to a knowledge-based system that is designed and developed to use previous case scenarios (similar past problems) to interprete or proffer a solution to a problem.

In design and implementation of any case-based reasoning application, there are four (4) Rs involved: retrieve, reuse, revise, and retain.

5 0
3 years ago
Hellpppppppppppppppp
jonny [76]

Answer:

i can't see your problem

6 0
2 years ago
Read 2 more answers
_____ of a global information system (GIS) concentrates on medium-range activities that move an organization toward achieving lo
Dafna11 [192]

Answer: (A) Tactical support

Explanation:

 GIS is the global information system in which the data is delivered worldwide in the form of information system. The global information system achieve long term goals in an organization.

  • The tactical support is used in the global information system for concentrating the activities on the medium range in an organization.  
  • The tactical support is one of the effective way to producing the desirable result and also achieve the main strategic objective.

Therefore, Option (A) is correct.

8 0
3 years ago
What is targets net worth in 2020 (i will see if you put in 2019)
Schach [20]

Answer:

62.6 billion

Explanation:

3 0
3 years ago
The Review tab in Microsoft Publisher provides two groupings called _____. Proofing and Language Spell Check and Research Proofi
anastassius [24]

Answer:

Proofing and language.

Explanation:

8 0
3 years ago
Other questions:
  • Dell Computer purchases parts and resources for its computers from multiple suppliers that are spread across the world. This pra
    8·1 answer
  • What is a function library?
    11·1 answer
  • Anyone wanna play among us UwU code is TAEQPQ
    15·2 answers
  • In 1-2 sentences, describe some keyboard shortcuts you have used during this lesson to save you time.
    13·2 answers
  • Analytical CRM systems are the input for operational CRM systems.<br><br> True<br><br> False
    11·1 answer
  • Define a class, addresstype, that can store a street address, city, state, and zip code. use the appropriate functions to print
    11·1 answer
  • The _______ of a secondary storage device indicates how much data the storage medium can hold.
    13·1 answer
  • What is a computer OPERATING SYSTEM?
    5·1 answer
  • Where does the list of incoming mail appear in gmail
    13·2 answers
  • PLS REPLY ASAP WILL MARK BRAINLIEST
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!