chubbybunny1304 chubbybunny1304
  • 21-07-2022
  • Computers and Technology
contestada

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

Respuesta :

1207449
1207449 1207449
  • 21-07-2022

Answer: I am supposed to write a few lines of code to create a conditional expression (ternary operation) that evaluates to string "negative" if user_val is less than 0 and "non-negative" if 0 or greater than 0.

The code I currently have prints "negative" when the number is less than zero but when a number 0 or greater is assigned to user_val it doesn't print "non-negative."

Answer Link

Otras preguntas

A woman insists that she will never marry a man as short as or shorter than she, knowing that only one man in 400 falls into this category. Assuming a mean heig
Which was not a cause of the European Enlightenment? (5 points) A) the Protestant Reformation B) the Scientific Revolution C) secular humanism D) the monastic m
Round 4806 to the nearest 1000?
Why wasn't Kenny friends with LJ anymore
Which of the following does not occur during interphase? A. Replication B. Translation C. Cytokinesis D. An increase in the number o
what temperature Is 6 degrees less than 2 degrees Celsius
The history of writing about history is called _____.
Jason is 5 foot 11 inches tall. Amy is 63 inches tall. Who's taller and by how much 1 foot = 12 inches
3x squared -16x - 7=5
In 1959, Mary Leakey discovered the bones of Zinj, a ___ ancestor of modern humans. A. premier B. preposterous C. pretentious D. primeval