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

The point is located three units to the left of the y-axis and four units above the x-axis.
Look at the map carefully which of the following choices best describes why the capture of Vicksburg was so significant for the union?
Discuss risks associated with people in cyber threat
Why does a straw look broken viewed in a glass of water?
Name African Amer 1. What was the Middle Passage in the Slave Trade?
11. The length of a rectangle is 4 units greater than its width for the length of the rectangle Write an expression
The guarantee of equal treatment for all people under the law is called ______.
Subtract the fractions and reduce to lowest terms: 89 - 6 2/3
The hard palate is formed by the1. ethmoid bone.2. maxillary bone.3. palatine bone.A 1 onlyB 1 and 2 onlyC 2 and 3 onlyD 1, 2, and 3
Solve the following equation using the quadratic formula x^2-8x 97 = 0 The answer choices are in the picture