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
Anastasy [175]
4 years ago
13

Python provides a special version of a decision structure known as the ________ statement, which makes the logic of the nested d

ecision structure simpler to write.
Computers and Technology
1 answer:
IrinaVladis [17]4 years ago
7 0

Answer:

if-elif-else                                            

Explanation:

In Python if condition is used to decide whether a statement or a block of statements is to be executed or not based on the condition, if the condition evaluates to true then the block of statements is executed and if the condition is false then it is not executed.

Sometimes we need to execute some other statement when the condition is false. For example

if (number1 <= number2)

print (number1,  "is the smallest")

Lets suppose we want to print another statement if this condition evaluates to false. If the condition gets false then the following message should be displayed:

print(number 2, "is the smallest")

For this purpose else statement is used along with if statement to execute the block of code when the if condition evaluates to false.

if (number1 <= number2)

print (number1,  "is the smallest")

else:

print(number 2, "is the smallest")

Now what if there are three numbers or more numbers to be compared in order to identify the smallest number from the given numbers. So in this case we have multiple options to be checked. else statement will not be enough a  for else there can be at most one statement. With if elif else multiple conditions can be checked and if any of the condition evaluates to true then its block of code is executed and if none of the condition is true then the last else statement will be executed.

For example:

if (number1 <= number2) and (number1 <= number3):

print (number1,  "is the smallest")

elif (number2 <= number1) and (number2 <= number3):

print (number1,  "is the smallest")

else:

print (number3,  "is the smallest")

In this example number1 is compared to number2 and number3. If both numbers are less than number1 then the program control goes to elif statement where number2 is compared to number1 and number3. if this condition is false too then the final else part will be printed which is that number3 is the smallest.

Take another example where there are more number of expressions to be checked.

val = 50

if (val == 40):  

   print ("value is 40")  

elif (val== 35):  

   print ("value is 35")  

elif (val == 25):  

   print ("value is 25")  

elif(val==15):

    print ("value is 15")  

else:  

   print ("value is not present")

This will output the else part value is not present, because none of the condition evaluates to true.

You might be interested in
___________ is an unsecured client server application / protocol that transfers files between two computers.
Alexus [3.1K]
It is known as the File Transfer Protocol or FTP. It is based on a customer server demonstrate design and uses isolate control and information associations between the customer and the server. FTP clients may conform themselves with an unmistakable content sign-in convention, regularly as a username and secret word, yet can interface namelessly if the server is designed to permit it.
6 0
4 years ago
The throws clause of a method: a. specifies the exceptions thrown by the calling method. b. specifies the exceptions a method th
Wittaler [7]

Answer:

Option B

Explanation:

8 0
3 years ago
What command is used to locate all occurrences of the word "dog" in a document?
rosijanka [135]

Microsoft Word can easily find text in your document. This search is handled by the Find command. To locate the occurrences of the word dog in a word document, you can either click the find button on the home tab or press the combination keys ctrl+F and type the word dog. You also press ctrl+G. The Find and Replace dial box will pop up, with the Go To tab displayed. You will go ahead and click the Find tab and type the word dog.

3 0
3 years ago
Read 2 more answers
Which sns gets its names from one of its unique features
Komok [63]

Answer:

no

Explanation:

3 0
3 years ago
Identity management programs often implement a _________system that facilitates the management of user accounts.
Trava [24]

Answer:

single sign-on

Explanation:

Identity management programs in computer operation involve an administrative process that is carried out by implementing a SINGLE SIGN-ON system that facilitates the management of user accounts.

The purpose is to identify, validate, and approve an individual or group of people to have permission to various applications, computer systems, or networks by linking user rights and limitations with created identities.

Hence, in this case, the correct answer is SINGLE SIGN-ON

6 0
3 years ago
Other questions:
  • Enter a nested lookup function in cell E4 that uses the cells E2 and E3 to return a specific sales record. For example, using th
    14·1 answer
  • Dani needs to present a mathematical formula to his audience. How should he start the process of adding an equation to a slide?
    5·1 answer
  • To track conversions in an app, you can add the firebase sdk to your app. sdk stands for:
    5·1 answer
  • Graded Assignments may be found at the end of each chapter of the required textbook under the title "Real-World Exercises". Each
    15·1 answer
  • A virus or worm can have a payload that installs a(n) __________ door or trap-door component in a system, which allows the attac
    14·2 answers
  • HELP
    13·1 answer
  • A Java main method uses the parameter (String[ ] variable) so that a user can run the program and supply "command-line" paramete
    5·1 answer
  • Look at the trend in the US labor force participation rate. If increasing the number of women and men in the labor force can be
    13·1 answer
  • 4. When you see ##### in a cell, you should
    14·2 answers
  • Anyone know what I’m supposed to do?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!