bobhig

Boolean 1

Mar 29th, 2019
98
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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")
RAW Paste Data