这个python程序是用来从用户获取2个数字的,其中一个是乘法表,它是用来增加的,另一个是数字停在。这也是迄今为止该程序:TypeError:'builtin_function_or_method'对象是不可以订阅的 - python
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循环
格式代码正确 –
',而所有[计数<= UserInput]:'是无效的。 – iMom0
while all [count <= UserInput] - 您正在发明新的语法... next in line。 –