我如何 loop/repeat/range(无论你怎么称呼它)在 python 中打印文本?

how do i loop/repeat/range(whichever you call it) print a text in python?

我在这段不会循环打印的代码中做错了什么?请发送正确答案。

repr(
"input()means you tell the computer something"
)
range(
"input()means you tell the computer something"
)

我不太确定你想用这段代码实现什么,但是有多种方法可以在 python 中重复打印一个字符串。这里有几种方法:

  1. 使用 while 循环(这将 运行 无限)
while True:
    print("input()means you tell the computer something")
  1. 使用for循环(如果你想打印一定次数)
times = int(input("How many times do I repeat?: "))
for i in range(times):
    print("input()means you tell the computer something")

我希望这能回答你的问题