TheElement99
TheElement99 TheElement99
  • 17-05-2021
  • Computers and Technology
contestada

In python, Create a conditional expression that evaluates to string "negative" if user_val is less than 0, and "non-negative" otherwise.

Respuesta :

WiseKun WiseKun
  • 17-05-2021

I am assuming that user_val is an inputted variable and a whole number (int)...

user_val = int(input("Enter a number: "))

if user_val < 0:

   print("negative")

else:

   print("non-negative")

Answer Link

Otras preguntas

An electric field is represented by the force on which particle
if the area of a triangle is 84 in2 what is the value of xA. 4.2 inB. 168 inC. 6 inD. 24
what is the next letter cd hi mn RS
All organic molecules contain carbon, bonded to other elements. Which of these elements would not be found in an organic molecule? A. Helium B. Hydrogen C.
Nadia bought 4.3 pounds of ham on Tuesday and 1.7 pounds of ham on Wednesday. She spent a total of $41.94. What was the price of the ham per pound?
Computer user A will use Disk Cleanup, accessed from the Accessories menu, to remove temporary Internet files and files from the Recycle Bin. Computer user B wi
The cone shown has a volume of 12π in3. Find the volume of a cylinder with the same base and height as the cone. A) 4π in3 B) 9π in3 C) 24π in3 D) 36π in3
When asked to describe resistance you say, "It is an object's ability to
In the late 1800's, the U.S. government treated Native Americans in an unfair way. What are 3 peices of evidence that are against this
Everyone else passed the class, so it should be easy for you to pass as well. Which kind of logical fallacy is being committed in this argument? popular appeal