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

Another question i will give brainlilest!
What are the coordinates of point W" on the final image? Figure WXYZ is transformed using the rule fy-axis • T4, 2(x, y). Point W of the pre-image is at (1,6).
A group of 28 nations in North America and Europe formed to keep peace and defend all members in times of war.
according to the information provided in this class, where do a majority of car-bicycle collisions occur and at what time of day
Taylor wants to install new carpet in her living room. The room length is 15 ft and the width is 15 ft. If the cost of the carpet is $8 per square foot, what wi
Please help me out with this
Describe the last days of Adolf Hitler.
What type of stretching should joan do before a sport?
8th grade science questions about force please help :) I'm sooo close and don't understand it
What is the solution of the equation 3x = 12? Round your answer to the nearest ten-thousandth.