Created
March 4, 2012 16:07
-
-
Save seniorihor/1973677 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
#!/usr/bin/python3.2 -tt | |
# *-* coding: utf-8 *-* | |
allow_names = ['Mila', 'Ihor', 'Stas', 'Michel', 'Bogdan'] | |
name = str(input('Enter your name: ')) | |
def birthday(name): | |
i = 0 | |
while i < len(allow_names): | |
# Check name | |
if allow_names[i] == name: | |
print("Hello, " + name + '!!! You are in list invited!') | |
i+=1 | |
else: | |
exit('Hello, stranger! You are not in the list!') | |
# Check time | |
time = float(input('When the party start? ')) | |
come = float(input('What time is it? ')) | |
if time == come: | |
print('You came in time!') | |
elif time < come: | |
exit("It's too fast! Come in later...") | |
elif time > come: | |
exit("It's too late! Come to the next year...") | |
birthday(name) | |
print('Welcome to our party!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment