我将使用嵌套循环创建乘法表范围,以打印表,但显示错误。
tables = int(input("Enter table"))
for table in range(2,tables+1):
for num in range(1,11):
print(f"{table} * {num} = {table*num}")
TypeError Traceback (most recent call last) <ipython-input-23-b1cb99dac75d> in <module> 2 tables = int(tables) 3 ----> 4 for table in range(2,tables+1): 5 for num in range(1,11): 6 print(f"{table} * {num} = {table*num}") TypeError: 'int' object is not callable```