Boolean logic | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Boolean logic

humidity = int(input()) if humidity > = 40 and humidity<=60: print("norm") Please help … It says syntax error

31st May 2022, 2:44 PM
Mbalenhle Shamima Nhlapo
Mbalenhle Shamima Nhlapo - avatar
2 Answers
+ 6
You have three mistakes 1. Remove space after > 2. Remove extra space after 40 3. Don't use enter for second condition. Below is the correct code you can run humidity = int(input()) if humidity >= 40 and humidity<=60: print("norm")
31st May 2022, 2:50 PM
Tarun Gautam
Tarun Gautam - avatar
+ 1
You can also use it like this: if 40 <= humidity <= 60: ...
1st Jun 2022, 6:41 AM
Sousou
Sousou - avatar