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 are five types of applications you can create in Visual Basic 2017?
vampirchik [111]

Answer:

1) Windows Desktop applications

2) Windows Store apps

3) Web/Cloud applications

4) Office/SharePoint applications

5) Database applications.

6 0
3 years ago
Read 2 more answers
Dunbar's number, 150, refers to the number of:
Artyom0805 [142]

Answer:

Dunbar's number is a suggested cognitive limit to the number of people with whom one can maintain stable social relationships

Explanation:

I know this

6 0
2 years ago
When entering a function or formula in a cell, which is the first character
AnnZ [28]

Answer:

B

Explanation:

6 0
3 years ago
A company is completing research and development for software which it is planning to produce in approximately 2 years time. Whi
likoan [24]

Answer:

The transistor density of the hardware which will exist in 2 years time will likely be double the current processing speeds.

Explanation:

The other 3 options are incorrect

7 0
3 years ago
1. Explain the distinction between interpretation and compilation. What are the comparative advantages and disadvantages of the
serious [3.7K]

Answer:

11: Compiler translates a high level source program into a target equivalent (machine language).

An interpreter implements a virtual machine, the high-level programming language of which is the "machine language." The interpreter reads statements more or less one at a time in that language, and executes them as they go along.

12: One could also consider Java either. A compiler (complicated translator) can create code, which is then executed by a complicated virtual machine (interpreter)

13: A preprocessor is an initial translator which removes comments and white space, and group characters together into tokens such as keywords, identifiers, numbers, and symbols, as well as simple syntactic structure analyses. A compiler uses in-depth analysis and nontrivial transformation.

14: C++ implementations based on the early AT&T compiler created an intermediate program in C rather than assembly language

15: Stack-based language, similar to modern Java compiler byte code

16: A method in which a simple interpreter implementation evolves into building more complex versions until the compiler is built.

17: A compiler which translates byte code into machine language immediately prior to each program execution.

18: Lisp and Prolog

19: TEX and TROFF are one of such compilers that translate high-level document descriptions into laser printer or phototypesetter commands. Query language processors for database systems are also compilers that translate languages such as SQL into primitive file operations.

21: without havin to call multiple tools with command-line tools, You can write an entire program in an IDE.

8 0
3 years ago
Other questions:
  • The technology (software) that automatically downloads website information to your computer is called ________.'
    15·1 answer
  • A(n ____ with a drop down menu provides consistency in function and appearance making it easy for users to learn and work with t
    7·1 answer
  • What are the advantage of transistors over vacuum tubes?
    6·1 answer
  • Antivirus software installed to scan and monitor malware activities on a server or workstation would be identified as a ________
    8·1 answer
  • True / False<br> 1. A byte is a standardized unit of measure that is always 8-bits.
    7·1 answer
  • Cell A1 contains the formula "=10+D2". If you copied A1 to B3, what would be the formula in B3?
    10·2 answers
  • Sebutkan beberapa contoh peralatan komunikasi zaman dahulu beserta dengan keterangannya!
    14·1 answer
  • Which of the following works on the pay-per-click (PPC) and cost-per-click (CPC) concept? ~ Plato
    9·1 answer
  • A descriptive study represents the highest level on the knowledge-level continuum.
    11·1 answer
  • Which of these five are Netflix Originals?1/5
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!