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
brilliants [131]
3 years ago
12

Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent singl

e conditional.
Computers and Technology
1 answer:
victus00 [196]3 years ago
3 0

Answer:

following are the program to the given question:

Program:

x = 0#defining an integer variable that holds a value

if x < 0:#defining if that checks x less than 0

   print("This number ",  x, " is negative.")#print value with the message

else:#defining else block

   if x > 0:#defining if that checks x value greater than 0

       print(x, " is positive")#print value with message

   else:#defining else block

       print(x, " is 0")#print value with message

if x < 0:#defining another if that checks x less than 0

   print("This number ",  x, " is negative.")

elif (x > 0):#defining elif block that check x value greater than 0

   print(x, " is positive")#print value with message

else:#defining else block

   print(x, " is 0")#print value with message

Output:

Please find the attachment file.

Explanation:

In this code, an x variable is defined which holds a value that is "0", in the next step nested conditional statement has used that checks the x variable value and uses the print method that compares the value and prints its value with the message.

In another conditional statement, it uses if that checks x value less than 0 and print value with the negative message.

In the elif block, it checks x value that is greater than 0 and prints the value with the positive message, and in the else block it will print the message that is 0.

You might be interested in
The specific term for expediting the delivery of software by breaking a task into smaller increments is called
Ksivusya [100]
Rapid Application Development is the specific term
8 0
3 years ago
A computer scientist creates an app that tells you a funny joke each time you touch the Joke button.
Lena [83]

Answer:

B And A

Explanation:

B: The controller renders a responce it can be seen as a manager and other parts are its workers and makes sure that other parts are "working" well

6 0
3 years ago
Can you help me in this question
Amiraneli [1.4K]

Answer:

6 2 and 0

Explanation:

This algorithm doesn't work if the list is not ordered ascending.

In this example it is not, and indeed the item "1" is never found.

first cycle: first=0, last=12 so midpoint=6

second cycle: first=0, last=5 so midpoint=2

last cycle: first=0, last=1 so midpoint=0

then last is assigned -1 so the while statement is no longer true.

7 0
3 years ago
How do I use this site?brainly.com
Zarrin [17]
You just answer other people’s questions you can also use this app to help you with your questions as well
5 0
3 years ago
To erase an entire entry in an excel cell and then reenter the data from the beginning, press the ____ key.
AVprozaik [17]
To erase an entire entry in an excel cell and then reenter the data from the beginning, press the ESC key. ESC stands for <span>Escape.
</span>The escape key is found <span>on most computer keyboards.  When the ESC key is presses t</span>hen the escape command is sent from the keyboard to a computer and this command o is interpreted by software as "stop". So, it is used to stop some actions.
5 0
3 years ago
Other questions:
  • Identify possible advantages and disadvantages of using automatic withdrawal to pay bills
    12·2 answers
  • Match these items. 1 . Naturalization Act stated that a foreigner had to live in the United States fourteen years to become a ci
    5·1 answer
  • IF ACCURATE = BRAINLY (if u answer rubbish randomness= reported AND if you got questions dont ask in answer slot= reported)
    13·1 answer
  • What is a computer network that provides connectivity in a geographic area or region larger than that covered by a local area ne
    7·1 answer
  • The keyboard usually has six rows of keys. Which of the following is not one of the key group categories?
    7·2 answers
  • Edible vaccines, a more controversial approach to vaccine development, have been investigated by scientists. Plants can be genet
    6·1 answer
  • Help meee pleaseeee
    5·1 answer
  • I need neveahbowe to see this.
    10·1 answer
  • Which generation of computer is most popular and why?
    9·1 answer
  • HELP ASAP
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!