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, 23.06.2019 18:50
What is transmission control protocol/internet protocol (tcp/ip)? software that prevents direct communication between a sending and receiving computer and is used to monitor packets for security reasons a standard that specifies the format of data as well as the rules to be followed during transmission a simple network protocol that allows the transfer of files between two computers on the internet a standard internet protocol that provides the technical foundation for the public internet as well as for large numbers of private networks
Answers: 2
question
Computers and Technology, 24.06.2019 14:00
When creating a field in a table, you must set the to determine what type of data the field can store. field property data type field type data property
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
How are roger williams, james oglethorpe, and william penn similar?
Answers: 3
question
Computers and Technology, 24.06.2019 20:10
Approximately what portion of global employers tends to use social media websites to hire new employees?
Answers: 1
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, 28.09.2020 23:01
question
Mathematics, 28.09.2020 23:01
question
Mathematics, 28.09.2020 23:01
question
Arts, 28.09.2020 23:01
question
Mathematics, 28.09.2020 23:01
question
History, 28.09.2020 23:01
question
Chemistry, 28.09.2020 23:01
question
Mathematics, 28.09.2020 23:01
Questions on the website: 13722360