0

Boolean Logic 2

I am working on the problem referencing humidity. The 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. My Code: humidity = int(input()) #your code goes here if humidity >= 40 or humidty < 60: print("norm") else: print())

10th Sep 2021, 11:32 AM
Devin Robinson
4 ответов
+ 3
That worked thanks. its the small detail stuff sometimes. ill try to pay closer attention.
10th Sep 2021, 11:48 AM
Devin Robinson
+ 1
Oh ok that makes sense thank you
10th Sep 2021, 11:46 AM
Devin Robinson
+ 1
humidity = int(input()) if humidity>=40 and humidity<60: print("norm") it will work 100% i garentee
24th May 2022, 8:17 AM
Hrithika Reddy
Hrithika Reddy - avatar
0
Hi Devin! When you're trying to connect to condition using logical operators you have to compare both integers. Range of 40 and 60 inclusive means 60 must be included [40,60]. So, your condition needs to be if humidity >=40 and humidity <=60: Here it is your working code. humidity = int(input()) #your code goes here if humidity >= 40 and humidty <= 60: print("norm") else: print()
10th Sep 2021, 11:40 AM
Python Learner
Python Learner - avatar