Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pywapi
- import string
- import random
- weather_com_result = pywapi.get_weather_from_weather_com('20740', 'imperial')
- text = weather_com_result['current_conditions']['text']
- temp = weather_com_result['current_conditions']['temperature']
- temp = int(temp)
- if("Sunny" not in text):
- print("No videochat will occur today because the weather is " + text + ", not Sunny.")
- else:
- print("There was a " + str(temp) + " percent change of videochatting today")
- random_int = random.randrange(1, 101)
- if(random_int <= temp):
- print("And you will videochat today!")
- else:
- print("However fate has determined that you shall not.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement