subject

Create a conditional expression that evaluates to string "negative" if user_val is less than 0, and "non-negative" otherwise. Sample output with input: -9
-9 is negative

here is the code:
user_val = int(input())

cond_str = 'negative' if user_val < 0 else cond_str

print(user_val, 'is', cond_str)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
How can a broadcast station be received through cable and satellite systems?
Answers: 1
question
Computers and Technology, 22.06.2019 15:20
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
The best definition of an idiom is a. a word or phrase that describes a noun b. a word or phrase describing a verb c. a phrase containing figurative language in which the word expresses a different idea from its exact meaning d. a phrase that compares two unlike objects or ideas
Answers: 2
You know the right answer?
Create a conditional expression that evaluates to string "negative" if user_val is less than 0, and...
Questions
question
Mathematics, 05.03.2021 01:00
question
Mathematics, 05.03.2021 01:00
question
Mathematics, 05.03.2021 01:00
question
Mathematics, 05.03.2021 01:00
question
Mathematics, 05.03.2021 01:00
question
Mathematics, 05.03.2021 01:00
question
Mathematics, 05.03.2021 01:00
question
Mathematics, 05.03.2021 01:00
question
Mathematics, 05.03.2021 01:00
Questions on the website: 13722367