Skip to content

Instantly share code, notes, and snippets.

@zakirangwala
Last active September 23, 2020 13:26
Show Gist options
  • Save zakirangwala/05e88ef67df7ef18af0f971811d2793d to your computer and use it in GitHub Desktop.
Save zakirangwala/05e88ef67df7ef18af0f971811d2793d to your computer and use it in GitHub Desktop.
Tutorial Code : Greet Function
import datetime
# Greeting Function
def greet():
hour = int(datetime.datetime.now().hour)
if hour >= 0 and hour <= 12:
speak("Good Morning!")
print("Good Morning!")
elif hour > 12 and hour < 16:
speak("Good Afternoon!")
print("Good Afternoon!")
elif hour > 16 and hour < 20:
speak("Good Evening!")
print("Good Evening!")
else:
speak("Good Night!")
print("Good Night!")
print("Hi, I am your virtual assistant. How can I help?")
speak("Hi, I am your virtual assistant. How can I help?")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment