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
MariettaO [177]
2 years ago
8

In python please:

Computers and Technology
1 answer:
Vikki [24]2 years ago
3 0

Answer:

"

if 'marsupial' in dictionary:

   del dictionary['marsupial']

else:

   print("The key marsupial is not in the dictionary")

"

Explanation:

So you can use the keyword "in" to check if a certain key exists.

So the following code:

"

if key in object:

   # some code

"

will only run if the value of "key" is a key in the object dictionary.

So using this, we can check if the string "marsupial' exists in the dictionary.

"

if 'marsupial' in dictionary:

   # code

"

Since you never gave the variable name for the variable that references a dictionary, I'm just going to use the variable name "dictionary"

Anyways, to delete a key, there are two methods.

"

del dictionary[key]

dictionary.pop(key)

"

Both will raise the error "KeyError" if the key doesn't exist in the dictionary, although there is method with pop that causes an error to not be raised, but that isn[t necessary in this case, since you're using the if statement to check if it's in the dictionary first.

So I'll just use del dictionary[key] method here

"

if 'marsupial' in dictionary:

   del dictionary['marsupial']

else:

   print("The key marsupial is not in the dictionary")

"

The last part which I just added in the code is just an else statement which will only run if the key 'marsupial' is not in the dictionary.

You might be interested in
One of the disadvantages of Photoshop Express is that it does not have a Black and White effect. True False
Katarina [22]
False,
The Pop Color tool can be used to select one particular color, changing the rest of the image to black and white. The effects available in Photoshop Express don't allow for a huge amount of customization
8 0
3 years ago
If you were a developer of software, what kind of software package would you develop? why ?​
Goshia [24]

Answer:

Software that would help my grandparents in the North end much money and help stop post harvest loss due to inadequate weather information Climate change etc

Explanation:

The app willbe able to tellif a soil is suitable forCropsthrough my othertechnologiesthat willcome with app it will alsodetect the whetherpattern accuratelyprovide securityin the farmand help farmers selltheir products online

7 0
3 years ago
Machine code and Object code is the same right?​
guapka [62]

Answer:

"True" Machine code and Object code is the same.

Explanation:

All code at the same level is considered the same code, so we can say that the machine code, byte code, and the object code with it is of the same type, all of which are considered as the lowest level associated with the common program, these are common. Also known as source code because it is used in translating different languages.

6 0
3 years ago
In a class hierarchy,
kondor19780726 [428]

Answer:

The correct answer to the following question will be Option D.

Explanation:

  • A collection of nested title scopes are defined by the class hierarchy, even though a collection of nested methodologies as well as blocks see in an everything else.
  • From the all, the lexical role characterizes the connection between certain scopes of names - if method d would be decided to declare somewhere within procedure c, therefore the namespace within the namespace of c would be nested.
  • The more common classes in such a family hierarchy were near the peak of the tree as well as more specific classes are towards the edges.

Other choices have no connection with the given situation. So Option D seems to be the right response.

4 0
3 years ago
Complete the missing part of the line to allow you to read the contents of the file.
Firlakuza [10]

Answer: Sorry I’m late but the answer is open

Explanation: Edge 2021

3 0
3 years ago
Read 2 more answers
Other questions:
  • The CSS relative positioning property called ____ moves the element relative to its original position but preserves the space re
    9·1 answer
  • How do media and networks interact
    11·1 answer
  • Gal runs a music store. He has a desktop computer in the back room that acts as a server. He has a point-of-sale terminal that c
    15·1 answer
  • When transporting data from real-time applications, such as streaming audio and video, which field in the ipv4 header can be use
    14·1 answer
  • To bundle links together in order to improve bandwidth availability and redundancy, what protocol is used
    6·1 answer
  • Help pls put them in order for me??
    9·2 answers
  • E) Point out the errors( if any) and correct them:-
    14·1 answer
  • 1.
    13·1 answer
  • Which type of data is most sensitive and should be protected from malware?
    7·1 answer
  • Online activities among businesses
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!