这是我当前的代码,当我运行它时,我得到一些错误......我不确定它们是什么.
Traceback(最近一次调用最后一次):
文件"D:/.实际W4/Lab3Problem1.py",第54行,在main()中
主nestediffunction()中的文件"D:/.Actual W4/Lab3Problem1.py",第8行
文件"D:/.Actual W4/Lab3Problem1.py",第27行,在nestediffunction if(booksread == 0):
NameError:未定义名称'booksread'
def main():
print("Welcome to Ryan's book club!")
booksread = int(input('Please enter the amount of books you have read so far: '))
# if (booksread < 0):
# print("That's impossible! Please re-enter the amount of books you have read: ")
# booksread1 = int(input('Please enter the amount of books you have read so far: '))
#simpleiffunction()
nestediffunction()
#eliffunction()
def simpleiffunction():
if (booksread == 0):
print('You have 0 points!')
if (booksread …Run Code Online (Sandbox Code Playgroud) sales = 1000
#def commissionRate():
if (sales < 10000):
print("da")
else:
if (sales <= 10000 and >= 15000):
print("ea")
Run Code Online (Sandbox Code Playgroud)
if (sales <= 10000 and >= 15000):行上的语法错误.特别是在等号上.