I need help finding out how to run my import code from a function!
sayTime(timespeech)
import time
list = ["whats the time","what's the time","WHAT'S THE TIME?","Whats the time","Whats the time?","What's the time?","WHATS THE TIME?","what's the time?","WHATS THE TIME"]
list2 = ["hi","Hi","Hello","hello","Hey","hey"]
while True:
answer = input("How can i help: ")
if answer in list:
timespeech.sayTime()
if answer in list2:
time.sleep(0.5)
print("Hi Max!")
time.sleep(2)
As you can see, i'm new to python. time speech is another .py file that when i do import timespeech runs. I'm attempting to run it via a function where it states if answer in list: timespeech.sayTime() i believe that you're meant to have it as def sayTime(timespeech): but i'm not sure what comes after that. Please Help!