この 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
どうすれば修正できますか?これは学校用であり、while ループを使用することを意図しているため、for ループの使用を提案しないでください。