print("\n手机店打折活动进行中……")
strweek = input("请输入中文星期(如星期一):")
inttime = int(input("请输入时间中的小时(范围0-23):"))
if (strweek == "星期二" and (inttime >=10 and intTime <= 11)) or (strweek == "星期五" and (intTime >= 14 and intTime =<15)):
print("恭喜你获得参与活动资格,快快选购吧!")
else:
print("对不起,你来晚了,期待下次活动…………")
最后是<= 你打错符号了 另外定义的inttime,用的时候有几个字母写成大写的了
print("\n手机店打折活动进行中……")
strweek = input("请输入中文星期(如星期一):")
inttime = int(input("请输入时间中的小时(范围0-23):"))
if (strweek == "星期二" and (inttime >=10 and inttime <= 11)) or (strweek == "星期五" and (inttime >= 14 and inttime <=15)):
print("恭喜你获得参与活动资格,快快选购吧!")
else:
print("对不起,你来晚了,期待下次活动…………")
inttime intTime
if里面intTime大小写不一致
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!