Created
August 6, 2019 19:57
-
-
Save sunnya97/3ec14ce1ba175040e706c2ab450ab936 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment