好吧,这个 python 程序打算从用户那里获取 2 个数字,一个是乘法表,它打算增加,一个是它应该停止的数字。这是到目前为止的程序:
count = 0
UI = 0
UserInput = 10
print ("Please type a number and press enter, this will be the multiplication table your sequence will go up in, then type another number and press enter, this will be the number the sequence will stop at.")
UI = int(input(""))
UserInput = int(input(""))
print = ("The program will now display all the numbers between your two numbers")
while all [count <= UserInput]:
count = count*UI
print (count)
但它一直在说:
Traceback (most recent call last):
File "C:/Users/Shahriyar/Documents/DiffProg.py", line 11, in <module>
while all [count <= UserInput]:
TypeError: 'builtin_function_or_method' object is not subscriptable
我如何解决它?并且请不要建议我使用 for 循环,因为这是用于学校的,我们打算使用 while 循环