Last active
September 23, 2020 13:26
-
-
Save zakirangwala/05e88ef67df7ef18af0f971811d2793d to your computer and use it in GitHub Desktop.
Tutorial Code : Greet Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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