【发布时间】:2021-08-16 05:13:19
【问题描述】:
我想知道是否有某种可以导入的命令或函数允许我根据输入的值多次运行命令。这可能没有任何意义,但希望它会从这里↓
num_of_rounds = input(int("type the amount of rounds you want to play"))
for num_of_rounds:
print("test")
这对我不起作用,我不知道如何使它起作用。
【问题讨论】:
-
同样可以工作,但不是输入命令,而是一个函数:
def rounds_func(number): for number: print("test") -
你的意思是
int(input(...)),而不是input(int(...))
标签: python