Advertisement
Shailrshah

Days of the week using Dictionary

Sep 13th, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. __author__ = 'Shail'
  2. def doMonday(): print("You're a workaholic!")
  3. def doTuesday(): print("You're no fun!")
  4. def doWednesday(): print("You have great sense of humor!")
  5. def doThursday(): print("You're religious!")
  6. def doFriday(): print("FUN FUN FUN FUN!")
  7. def doSaturday(): print("You're lazy.")
  8. def doSunday(): print("You like to wake up late!")
  9. def err():print("You're retarded");
  10.  
  11. takeaction = {
  12.     "Monday":doMonday,
  13.     "Tuesday":doTuesday,
  14.     "Wednesday":doWednesday,
  15.     "Thursday": doThursday,
  16.     "Friday": doFriday,
  17.     "Saturday": doSaturday,
  18.     "Sunday":doSunday
  19. }
  20.  
  21. takeaction.get(input("Enter your favorite day of the week: "), err)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement