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
A.<br> Post-It note<br> b.<br> notebook<br> c.<br> tutor<br> d.<br> spell check
Ostrovityanka [42]
What is this for? like what is the question?


4 0
3 years ago
How to calculate least count of a stopwatch
Nimfa-mama [501]
Look. You need to stop your watch at 00:00. And then you'll see that its least count is 0.01 second and then you should add your clocks' response time to make results more accurate.
8 0
3 years ago
Where can i make a 3d animation for free ( pls don't trick me)
Vinvika [58]

Answer:

I don't know if it would work for what you need but you could try scratch. (sorry if this isn't what you needed.)

4 0
3 years ago
You have compiled a new kernel using rpm. when you reboot, the new kernel is not the default selection on the boot menu. you use
vredina [299]
First, rpm is RedHat Package Manager. Compilation is done with gcc, the GNU C Compiler.

To add that kernel to grub2's menu, as root you'd need to run:

grub2-mkconfig > /boot/grub2/grub.cfg #redirection is favored by Red Hat

Check out the man page @ man grub2-mkconfig
5 0
3 years ago
What is tnylnk? I keep seeing people leave answers with this.....can someone explain what this is, please...I might give brainie
Naddika [18.5K]

Answer:

ITS A SCAM IT DOWN LOADS NASTY STUFF ON TO UR COMPUTER

Explanation:

hope this helps

8 0
2 years ago
Read 2 more answers
Other questions:
  • The protocol that enables computers on the Internet to communicate with one another is called _____.
    10·2 answers
  • The data in a data warehouse have which of the following characteristics?
    13·1 answer
  • Anna is making a presentation on the solar system. She wants to emphasize the planet names as they appear one by one on the pres
    11·1 answer
  • In the context of Information Technology Infrastructure Library, _____ delivers information technology IT services on an ongoing
    14·1 answer
  • A token is combination of hardware and software that acts as a gatekeeper and prevents unauthorized users from accessing private
    11·1 answer
  • Tips for being confident and entertaining when presenting?
    6·1 answer
  • A parent is browsing through a shopping website, looking for blue-colored striped socks for her child. She is fine if the socks
    15·1 answer
  • Not every organization integrates with the Internet, but all use some or most of the technology that gave rise to it.
    15·1 answer
  • What is a functional organisation? and how it functions​?
    12·1 answer
  • Which benefit does the Cloud provide to start-up companies without access to large funding?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!