Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
类型错误:';内置函数或方法';对象不可下标-python_Python - Fatal编程技术网

类型错误:';内置函数或方法';对象不可下标-python

类型错误:';内置函数或方法';对象不可下标-python,python,Python,这个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, t

这个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)
count=0
UI=0
用户输入=10
打印(“请键入一个数字并按enter键,这将是您的序列将进入的乘法表,然后键入另一个数字并按enter键,这将是序列将停止的数字。”)
UI=int(输入(“”)
UserInput=int(输入(“”)
print=(“程序现在将显示两个数字之间的所有数字”)
而所有的[count“它一直在说”:

回溯(最近一次呼叫最后一次):
文件“C:/Users/Shahriyar/Documents/DiffProg.py”,第11行,在

虽然all[count我建议看一下以下python文档:


正确格式化您的代码
while all[count while all]这段代码中有很多废话。为什么要将打印指定给字符串?您正在发明自己的DSL?
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
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