Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DAY_NAME_TO_ORDER = {
- "monday": "first",
- "tuesday": "second",
- "wednesday": "third",
- "thursday": "fourth",
- "friday": "fifth",
- "saturday": "sixth",
- "sunday": "seventh"
- }
- g = raw_input("What day are you leaving on?? ")
- matching_days = filter(lambda x: x in g.lower(), DAY_NAME_TO_ORDER.keys())
- if len(matching_days):
- selected_day = matching_days[0]
- print("That's a {0} day of the week".format(
- DAY_NAME_TO_ORDER[selected_day]))
- else:
- print("I don't know what day that is!")
- raw_input("PRESS ENTER TO CLOSE.")
Advertisement
Add Comment
Please, Sign In to add comment