Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import pywapi
  2. import string
  3. import random
  4.  
  5. weather_com_result = pywapi.get_weather_from_weather_com('20740', 'imperial')
  6.  
  7. text = weather_com_result['current_conditions']['text']
  8. temp = weather_com_result['current_conditions']['temperature']
  9.  
  10. temp = int(temp)
  11.  
  12. if("Sunny" not in text):
  13. print("No videochat will occur today because the weather is " + text + ", not Sunny.")
  14. else:
  15. print("There was a " + str(temp) + " percent change of videochatting today")
  16. random_int = random.randrange(1, 101)
  17. if(random_int <= temp):
  18. print("And you will videochat today!")
  19. else:
  20. print("However fate has determined that you shall not.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement