Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Boolean operators 1
- temp = int(input ("What is the temperature C? "))
- humidity = int(input ("What is the humidity %? "))
- movement = input ("Is movement detected Y/N? ")
- print(temp, humidity, movement)
- if temp > 20 and humidity > 80 and movement != 'Y':
- print ("Fan at medium speed")
- elif (temp > 20 or humidity > 80) and movement == 'Y':
- print ("Fan at high speed")
- else:
- print ("Fan at low speed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement