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 determines gravitational pull?<br><br> volume<br><br> mass<br><br> the sun<br><br> acceleration
Arte-miy333 [17]
C. The sun is correct!
8 0
3 years ago
Read 2 more answers
Automatic red-eye reduction settings work best on which type of flash?
zhuklara [117]

Answer:

c

Explanation:

3 0
2 years ago
What is not an example of a job skill
ikadub [295]

Being dishonest, irresponsible and unpunctual.Answer:

Explanation:

8 0
2 years ago
Read 2 more answers
The router can deliver packets directly over interfaces 0 and 1 or it can forward packets to Routers R2, R3, or R4. Describe wha
ra1l [238]

Answer:

Following are the solution to this question:

Explanation:

In point A:

It applies the AND operation with the subnet-mask that is  

=128.96.39.00001010 \ \ AND \ \ 255.255.255.10000000 \\\\= 128.96.39.0000000 \\\\= 128.96.39.0 \\\

This corresponds to a 128.96.39.0 subnet. This is why the router sent the packet to 0.

In point B:  

It applies the AND operation with the subnet-mask that is 255.255.255.128

= 128.96.40.00001100\  AND \ 255.255.255.10000000 \\\\ = 128.96.40.0000000\\\\= 128.96.40.0

This suits the 128.96.40.0 subnet. The router then sent R2 to the packet. The packet.

In point C:  

It  applies the AND operation with the subnet-mask that is 255.255.255.128

=128.96.40.10010111 \ AND \ 255.255.255.10000000 \\\\= 128.96.40.1000000\\\\= 128.96.40.128

It  applies the AND operation with the subnet-mask  that is 255.255.255.192

= 128.96.40.10010111 \ AND \ 255.255.255.11000000 \\\\= 128.96.40.1000000 \\\\= 128.96.40.128\\

All of the matches of its sublinks above.  

Its default R4 router was therefore sent to the router by router.

In point D:

It  applies the AND operation with the subnet-mask  that is 255.255.255.192

= 192.4.153.00010001 \ AND \ 255.255.255.11000000\\\\ = 192.4.153.0000000 \\\\= 192.4.153.0 \\\\

It matches the 192.4.153.0 subnet. It router has sent packet to R3 then.

In point E:

It  applies the AND operation with the subnet-mask  that is 255.255.255.128

= 192.4.153.01011010\  AND \ 255.255.255.10000000 \\\\= 192.4.153.0000000 \\\\= 192.4.153.0

There, neither of the subnet inputs correlate with the ip address with the same subnet mask.

It  applies the AND operation with the subnet-mask  that is 255.255.255.192

=192.4.153.01011010\ AND \ 255.255.255.11000000 \\\\ = 192.4.153.0100000 \\\\= 192.4.153.64

It does not correlate to the subnet entries for same subnet mask, and therefore neither of the entries matches their corresponding ip address entries.  

Mask of the subnet.  That packet would therefore be sent to the default R4 router by the router.

4 0
3 years ago
If you cause a car accident, which type of insurance will require you to pay the least out of pocket?
Luden [163]
A high deductible plan if that person blames you for it and said that it was on purpose
5 0
3 years ago
Other questions:
  • Which term describes the distinct number of colors a graphic contains? (1 point)?
    10·1 answer
  • )in the link based implementation of the ADT sorted list what is the worst case time efficiency of the remove method?
    7·1 answer
  • We never need to use a forward declaration when invoking a public subprogram. true or false?
    15·1 answer
  • Label 14 parts of the inside of a computer
    6·1 answer
  • Jeremy Aronoff has purchased a new laptop. He wants to customize the operating system to meet his
    7·1 answer
  • What is an accurate definition of a goal?
    15·2 answers
  • Creating parts that are interchangeable in manufacturing terms is key to the ____ line
    15·1 answer
  • Cable Internet access can be described with which feature?
    5·2 answers
  • 100 POINTSSSSSSS!!
    5·1 answer
  • Carlos has become pretty efficient at using the Word Processor but he takes time to use the menu each time he saves, prints and
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!