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
What in the world is this for and how do you use it
iVinArrow [24]

Answer:

This page is so that we can ask something and help each other with those questions or school or university assignments

Explanation:

6 0
3 years ago
Read 2 more answers
QUESTIONS Which of the following use cases are suitable for compute-optimized cloud offering? ОА. None of the listed O B. Highly
Ede4ka [16]

Answer:

E. All of the listed ​

Explanation:

For compute-optimized cloud offerings like AWS, suitable use cases are - gaming, distributed analytics, and scientific modeling. Since all these are suitable, the correct answer is E.

4 0
3 years ago
A persons decision to take action without being asked is
Nimfa-mama [501]

Answer:

Initiative

Explanation:

Initiative: the power or opportunity to act or take charge before others do.

5 0
3 years ago
If you are referencing cell (C2)in Excel and want to be able to copy the formula and keep using the data in cell C2 in every pla
sergiy2304 [10]

If you are referencing cell (C2)in Excel and want to be able to copy the formula and keep using the data in cell C2 in every place you copy it to, the way to reference the cell? is known to be $C$2.

<h3>What is a cell reference in Excel?</h3>

A cell reference is known to be called a cell address and this is seen as a make up of a column letter and also those of  row number that tells a cell on a worksheet.

Hence, If you are referencing cell (C2)in Excel and want to be able to copy the formula and keep using the data in cell C2 in every place you copy it to, the way to reference the cell? is known to be $C$2.

Learn more about cell referencing from

brainly.com/question/19035038

#SPJ1

8 0
2 years ago
In an ipv4 address, what are the maximum number of bits that can be used to identify the network address
Solnce55 [7]
Up to 24 bits can be used to identify unique <span>networks.</span>
5 0
3 years ago
Other questions:
  • Suppose a computer can execute 1 billion instructions/sec and that a system call takes 1000 instructions, including the trap and
    10·1 answer
  • What is data. Explain it in brief
    11·2 answers
  • Within the Chart Design tab, which section is used to change the data of a previously created chart?
    12·1 answer
  • I have an airsoft pistol and I needed to take it apart to repair it and I lost some screws that were tiny and I dont know what t
    14·1 answer
  • Which component of the windows desktop allows you to retrieve files that have recently been deleted?
    11·1 answer
  • Which of the following best describes professional behavior in the IT field?
    6·1 answer
  • Describe two circumstances where access services might get implemented by organizations please.​
    9·1 answer
  • What happens when text is added to grouped objects that is larger than an object ?
    9·2 answers
  • How is the architecture converted into software code? Elaborate the steps its passes through with help of examples / Diagram.
    15·1 answer
  • what component of virtualization controls all physical memory, and thus has the ability to make any unused memory pages in each
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!