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 guidance identifies federal information security controls?
Vladimir79 [104]

Answer:

<u>FIPS</u> <u>Publication</u> <u>2</u><u>0</u><u>0</u>, the second of the mandatory security standards, specifies minimum security requirements for information and information systems supporting the executive agencies of the federal government and a risk-based process for selecting the security controls necessary to satisfy the minimum security..

Explanation:

Hope it helps you..

Your welcome in advance..

(ㆁωㆁ)

3 0
2 years ago
Which characteristic of a company suggests that it has an informal work culture?
goldenfox [79]
The main characteristic of a company with suggests that it operates with an informal work culture is flexible working hours. With this kind of work culture, <span>workers are allowed to alter their workday start and finish times; and are not required to strictly follow the traditional work arrangements of the standard 9 a.m. to 5 p.m</span>
6 0
3 years ago
Headers and footers are those little identifiers that run in the middle of your document. true or false.
lianna [129]
False. they are the ones that let you include information (logo, name of the company, etc.) at the bottom and top of a page without making them part of the main text.
7 0
2 years ago
What does the following statement do? double[] array1 = new double[10]; A. Declares array1 to be a reference to an array of doub
Crank

Answer:

The answer is "Option D".

Explanation:

In the given code an array that is "array1" is declared that stores double value because its data type is double. This array stores 10 element, that is equal, and between 0 to 9, because array indexing always starts from 0. In the given array declaration code all options are correct, that can be described as follows:

  • In option A, It is correct, because all element stores double value.
  • In option B, It is correct, because the size of the array is 10.
  • In option C, It is also correct, because it ranges between 0 to 9.
7 0
3 years ago
If you add text, delete text, or modify text on a page, Word recalculates the location of automatic page breaks and adjusts them
Veronika [31]

Answer:

A. True

Explanation:

Microsoft word is a text format application used to create documents. As text are inputted in its pages, the words and characters are counted. when a page is full, microsoft word automatically breaks the page, creating another like a series of pages in a book.

As more text are added and deleted, the page break is adjusted to fit the remaining character space of that page.

4 0
3 years ago
Other questions:
  • What does a file extension tell you?
    14·1 answer
  • _____ software can help a company manage security, enforce corporate strategies, and control downloads and content streaming fro
    11·1 answer
  • Use the Web as a resource to study the PDF format. a. Describe how PDF provides output that is consistent across different types
    8·1 answer
  • Approximately what percent of desktop PCs are used for work-related purposes?
    13·2 answers
  • Using either a UNIX or a Linux system, write a C program that forks a child process that ultimately becomes a zombie process. Th
    8·1 answer
  • Where could an identity theft access your personal information?
    9·2 answers
  • What data unit is addressed based on the IP address of the recipient?
    8·1 answer
  • Where can i watch bnha movie 2 online for free, with no sign up or pay?
    6·2 answers
  • What is the behavior of an element with static positioning in regard to the page layout?
    12·1 answer
  • the human resources department requests a list that contains the number (i.e. count) of orders taken on each date, grouped by th
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!