这是我的代码,我面临的问题是 NameError: name 'hour' is not defined

时间:2021-04-07 05:44:12

标签: machine-learning coding-style resolution nameerror

def wishMe ():
    hour = int(datetime.datetime.now().hour)
if hour>0 and hour<12:
 Speak ("Good Morning!")

elif hour>12 and hour<18:
 Speak ("Good Afternoon!")

if __name__=="__main__":
    wishMe()

0 个答案:

没有答案