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]
3 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]3 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
Thiết kế biểu đồ thực thể liên kết và tập lược đồ cơ sở dữ liệu quan hệ cho các bài toán quản lý sau:
Paladinen [302]

Answer:

sorry please write in English than i help.you i don't understand your language

3 0
2 years ago
How is technology used in the voting process?
Semmy [17]
Each person has a electronic chip-enabled ID card, which lets them vote on the internet. The ID card is put into the card reader that is connected the computer. :)
7 0
2 years ago
Brief deacription of how hard drives have evolved
Zepler [3.9K]

Answer:

The first HDD was created by IBM in 1956 and was the size of a refrigerator. The total storage capacity was 5 MB and only two heads were used to read the disks. The 1970s offered a hard disk drive in much smaller shells with the ability to store roughly 60 MB.

Please Mark Brainliest If This Helped!

4 0
2 years ago
5-11) (Find the Smallest Value) Write an application that finds the smallest of several integers. Write a program which first as
Elanso [62]

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class num4 {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

       System.out.println("How many numbers? ");

       int n = in.nextInt();

       int []intArray = new int[n];

       //Entering the values

       for(int i=0; i<intArray.length;i++){

           System.out.println("Enter the numbers");

           intArray[i]=in.nextInt();

       }

       System.out.println(Arrays.toString(intArray));

       int min =intArray[0];

       for(int i =0; i<intArray.length; i++){

           if(min>intArray[i]){

               min = intArray[i];

           }

       }

       System.out.println("The Minimum of the numbers is "+min);

   }

}

Explanation:

  • Using Java programming language
  • Prompt the user for the number of values
  • Using Scanner class receive and store in a variable
  • Create an array of size n
  • Using an for loop continuously ask the user to enter the integers
  • Print the array of integers
  • Using another for loop with an if statement, find the smallest element in the array of numbers
  • Output the the smallest number
8 0
3 years ago
Authorized agent Confidentiality Integrity Encryption 6:53 PM ______ means that only people with the right permission can access
mojhsa [17]

Answer:

The answer is "Confidentiality"

Explanation:

Confidentiality alludes to shielding data from being gotten to by unapproved parties. All in all, solitary the individuals who are approved to do so can access delicate information. Imagine your bank records, You ought to have the option to get to them obviously, and representatives at the bank who are assisting you with an exchange ought to have the option to get to them, yet nobody else ought to. An inability to keep up Confidentiality implies that somebody who shouldn't have access has figured out how to get it, through deliberate act or coincidentally. Such a disappointment of Confidentiality, normally known as a breach  can't be helped. When the secret has been uncovered, it is highly unlikely to un-uncover it.

Assuming your bank records are posted on a public site, everybody can realize your bank account number, balance, and so forth, and that data can't be eradicated from their brains, papers, PCs, and different spots. Virtually all the significant security occurrences reported in the media today include loss of Confidentiality.

Thus, in summary, a breach of Confidentiality implies that somebody accesses data who shouldn't be permitted to.

6 0
2 years ago
Other questions:
  • A car with a 20-gallon gas tank averages 23.5 miles per gallon when driven in town and 28.9 miles per gallon when driven on the
    9·1 answer
  • ____ is high-quality encryption software that has become quite popular for creating secure e-mail messages and encrypting other
    9·1 answer
  • Effective feedback should focus on the behavior, not the person.<br><br> True<br> False
    9·2 answers
  • The ____ tool allows a user to connect to the active registry database and make changes that are effective immediately. editreg.
    12·1 answer
  • All of the following are challenges presented by changing technology as it relates to the special events field EXCEPT: A. the ab
    13·1 answer
  • Compare the applications below:
    10·2 answers
  • What is malware? a type of virus that spreads through a network connection a type of virus that targets programs and files any p
    8·1 answer
  • Explain the concept of conditional formatting​
    9·1 answer
  • What is system software?
    14·1 answer
  • What is the greatest number of bits you could borrow from the host portion of a class B subnet mask and still have at least 130
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!