這個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。 –