What's your Input
This commit is contained in:
37
whats_your_input/in.py
Normal file
37
whats_your_input/in.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python2.7 -u
|
||||
import random
|
||||
|
||||
cities = open("./city_names.txt").readlines()
|
||||
city = random.choice(cities).rstrip()
|
||||
year = 2018
|
||||
|
||||
print("What's your favorite number?")
|
||||
res = None
|
||||
while not res:
|
||||
try:
|
||||
res = input("Number? ")
|
||||
print("You said: {}".format(res))
|
||||
except:
|
||||
res = None
|
||||
|
||||
if res != year:
|
||||
print("Okay...")
|
||||
else:
|
||||
print("I agree!")
|
||||
|
||||
print("What's the best city to visit?")
|
||||
res = None
|
||||
while not res:
|
||||
try:
|
||||
res = input("City? ")
|
||||
print("You said: {}".format(res))
|
||||
except:
|
||||
res = None
|
||||
|
||||
if res == city:
|
||||
print("I agree!")
|
||||
flag = open("./flag").read()
|
||||
print(flag)
|
||||
else:
|
||||
print("Thanks for your input!")
|
||||
|
||||
Reference in New Issue
Block a user