- 1
boolean logic
The comfortable relative humidity for humans is between 40% and 60%. The given program takes the percent of humidity as input. Task Complete the code to output "norm" if the taken percent of humidity is in the range of 40 and 60 inclusive. Don't output anything otherwise. Sample Input 45 Sample Output norm
6 Answers
+ 9
print("norm" if 60>int(input())>40 else "")
+ 1
boolean logic
The comfortable relative humidity for humans is between 40% and 60%.
The given program takes the percent of humidity as input.
Task
Complete the code to output "norm" if the taken percent of humidity is in the range of 40 and 60 inclusive.
Don't output anything otherwise.
Sample Input
45
Sample Output
norm
else-statements
print("norm" if 60>int(input())>40 else "")
+ 1
humidity = int(input())
#your code goes here
if (humidity>=40 and humidity<=60):
print("norm")
0
humidity = int(input())
#your code goes here
if (humidity>=40 and humidity<=60):
print("norm")
0
humidity = int(input())
#your code goes here
if (humidity>=40 and humidity<=60):
print("norm")
0
humidity = int(input())
if 60>humidity and humidity>40:
print("norm")
else:
print("")
^^ this is better