我希望能够同时while True运行两个循环.这可能吗?
我是Python的新手,所以我不知道如何解决这个问题.
这是我制作的代码:
import time
def infiniteLoop():
while True:
print('Loop 1')
time.sleep(1)
infiniteLoop()
while True:
print('Loop 2')
time.sleep(1)
Run Code Online (Sandbox Code Playgroud)
现在,它只打印一个'循环1'
提前致谢