Question: Write a python IF statement that implements the following logic. A user enters a number that is saved in an integer variable called uni. If

Write a python IF statement that implements the following logic.

A user enters a number that is saved in an integer variable called "uni". If "uni" is negative, double it. If "uni" is positive, halve it. If "uni" is exactly 0 add 3 to it.

Display the result in a sentence like "Your number was positive, so I halved it, now it is" and the result. For example: "Your number was positive, so I halved it, now it is 3.5" is the user entered 7.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!