Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions