Advertisement
bobhig

Boolean 1

Mar 29th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. # Boolean operators 1
  2.  
  3. temp = int(input ("What is the temperature C? "))
  4. humidity = int(input ("What is the humidity %? "))
  5. movement = input ("Is movement detected Y/N? ")
  6.  
  7. print(temp, humidity, movement)
  8.  
  9. if temp > 20 and humidity > 80 and movement != 'Y':
  10.     print ("Fan at medium speed")
  11. elif (temp > 20 or humidity > 80) and movement == 'Y':
  12.     print ("Fan at high speed")
  13. else:
  14.     print ("Fan at low speed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement