Skip to content

Instantly share code, notes, and snippets.

@seniorihor
Created March 4, 2012 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seniorihor/1973677 to your computer and use it in GitHub Desktop.
Save seniorihor/1973677 to your computer and use it in GitHub Desktop.
#!/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