This commit is contained in:
ducoterra
2020-11-09 21:12:58 -05:00
parent f2b35db671
commit 09b4bc8f5b
25 changed files with 393 additions and 1 deletions

51
weather_app.py Normal file
View File

@@ -0,0 +1,51 @@
import random
warm = random.choice([True, False])
cold = not warm
raining = random.choice([True, False])
snowing = not raining
if warm or cold:
print("It's warm or snowing.")
if raining or warm:
print("It's raining or warm.")
if raining or snowing:
print("It's raining or cold.")
if cold or snowing:
print("It's cold or snowing.")
warm_guess = input("Is it warm? (y/n) ")
if warm_guess == 'y' and warm:
print('Correct!')
elif warm_guess == 'n' and not warm:
print('Correct!')
else:
print('Wrong!')
cold_guess = input("Is it cold? (y/n) ")
if cold_guess == 'y' and cold:
print('Correct!')
elif cold_guess == 'n' and not cold:
print('Correct!')
else:
print('Wrong!')
raining_guess = input("Is it raining? (y/n) ")
if raining_guess == 'y' and raining:
print('Correct!')
elif raining_guess == 'n' and not raining:
print('Correct!')
else:
print('Wrong!')
snowing_guess = input("Is it snowing? (y/n) ")
if snowing_guess == 'y' and snowing:
print('Correct!')
elif snowing_guess == 'n' and not snowing:
print('Correct!')
else:
print('Wrong!')