Skip to content
Permalink
a5256e7a02
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
29 lines (25 sloc) 1.38 KB
from datetime import datetime
def timeTalk(number):
now = datetime.now()
currentMonth = now.month
currentHour = now.hour
spring = [3, 4, 5]
summer = [6, 7, 8]
autumn = [9, 10, 11]
winter = [12, 1, 2]
if number == 1:
if currentHour >= 23 or currentHour <= 4:
return "Why are you awake? Do you know what time it is?"
elif currentHour >= 4 and currentHour <= 9:
return "You know what they say, the early bird catches the worm."
elif currentHour >= 11 and currentHour <= 15:
return "Did you had lunch yet? If not, you really should."
if number == 2:
if (currentMonth == spring[0]) or (currentMonth == spring[1]) or (currentMonth == spring[2]):
return "Spring is here, you should go get some fresh air."
if (currentMonth == summer[0]) or (currentMonth == summer[1]) or (currentMonth == summer[2]):
return "It's Summer!! Time to go get a tan at the beach."
if (currentMonth == autumn[0]) or (currentMonth == autumn[1]) or (currentMonth == autumn[2]):
return "It's Autumn, and that means the 'Winter is coming', better prepare yourself."
if (currentMonth == winter[0]) or (currentMonth == winter[1]) or (currentMonth == winter[2]):
return "The Winter is finally here, I hope you have a good Christmas or Hanukkah or whatever you celebrate."