Python Core - 21.2 Humidity level - hidden test failing | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python Core - 21.2 Humidity level - hidden test failing

I am having a hard time with the 21.2 practice of the Python Core course. The code I wrote is listed below. Running this always results in Test Case 4 failing. As this is a hidden test, I have no idea why this would fail when all other tests are successful. humidity = int(input()) if 40 <= humidity <= 80: print("norm") For testing, I created the following code: for humidity in list(range(-100,200,1)): if 40 <= humidity <= 80: print(str(humidity) + ": norm") else: print(str(humidity) + ": ") Which produces the following (abridged) output: 35: 36: 37: 38: 39: 40: norm 41: norm 42: norm 43: norm 44: norm 45: norm 46: norm 47: norm 48: norm 49: norm 50: norm 51: norm 52: norm 53: norm 54: norm 55: norm 56: norm 57: norm 58: norm 59: norm 60: norm 61: norm 62: norm 63: norm 64: norm 65: norm 66: norm 67: norm 68: norm 69: norm 70: norm 71: norm 72: norm 73: norm 74: norm 75: norm 76: norm 77: norm 78: norm 79: norm 80: norm 81: 82: 83: 84: 85: I wonder what I'm missing... If anyone could provide any help, I'd be very happy. Regards, Justin

10th Nov 2021, 11:33 AM
Justin Hunter
Justin Hunter - avatar
6 Answers
+ 1
hat wouldn't work because the 80 needs to become 60 to work
10th Nov 2021, 1:32 PM
⚡parky
⚡parky - avatar
+ 2
what is wrong with your code is that you needed to put if humidity >= 40 and humidity <= 60: the computer didn't recognize what you were trying input
10th Nov 2021, 11:59 AM
⚡parky
⚡parky - avatar
0
i hope this one will work humidity = int(input()) if humidity>=40 and humidity<=80: print("norm")
10th Nov 2021, 12:02 PM
Jasy Fabiano
Jasy Fabiano - avatar
0
Thank you guys! I must have read that question 20 times and didn’t once realize it was 60 rather than 80. A real facepalm moment!!!
10th Nov 2021, 1:52 PM
Justin Hunter
Justin Hunter - avatar
0
no problem if you need anymore help then just say
16th Nov 2021, 12:00 PM
⚡parky
⚡parky - avatar
0
hum=int(input('Enter the humidity: ')) if( hum >=40 and hum<=60): print('norm') else: print('')
21st Dec 2021, 4:36 PM
SANVIKA