我最近开始学习Python,虽然C ++很有趣,但Python看起来也很酷。我想让Python做一些事情,只要输入在特定数字范围内。
def main():
grade = float(input("“What’s your grade?”\n:"))
if grade >= 90:
print("“You’re doing great!”")
elif(78 >= grade <= 89):
print("“You’re doing good!”")
elif(77 >= grade > 65):
print("You need some work")
else:
print("Contact your teacher")
main()
当我编写elif语句时,问题出现了,我无法使Python仅在成绩介于65和89之间时打印“doing great”语句。您如何处理数字范围?