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 number of students at the new memorial high school increases at a rate of 6% per year. if there are 1600 students this year, how many students will there be
Exercise can help to lower blood cholesterol levels true or false
How is the prime minister chosen? A. Elected by members of the House of Lords B. Appointed by the monarch C. Elected by members of the House of
Plagiarism is considered a. Cheating c. Part of obtaining information b. Academic integrity d. Part of citing information
PLEASE HELP ME ASAP HAVE TO SEND THIS OVER GOOGLE DRIVE BEFORE 6 OCLOCK what does it mean to accept co-responsibility with those in authority?
which is greater 2/3 or 1/3
Jenna has 2 whole watermelon and one-third of another watermelon. Write a mixed number and improper fraction to represent the amount of watermelons she has.
Why might a newlywed chinese couple receive the gift of a scroll painting with peonies?
(x - 4)2 = 36 Which of the following expressions represents the solutions to the given equation?
in a fluid-filled container why is the pressure greater at the base of the container