2024-05-15 00:19:24 发布
网友
我不知道如何去做一遍又一遍执行的代码。我想实现这样的目标: (<;表示输入,>;表示输出)
message=input() print('Write down the text.')
>Write down the text. <qwerty >qwerty >Write down the text. <asd >asd
你是说像这样吗
while True: message=input("Write down the text: ") print(message)
你可以通过
while True: // code you want to execute repeatedly here
while循环将继续执行,直到条件变为false(在本例中,它永远不会这样做),因此如果/当您想要中断循环时,需要使用break语句
break
你是说像这样吗
你可以通过
while循环将继续执行,直到条件变为false(在本例中,它永远不会这样做),因此如果/当您想要中断循环时,需要使用
break
语句相关问题 更多 >
编程相关推荐