2024-10-02 06:25:26 发布
网友
我的循环行不通
Loop = True while loop: print ("hi") #should constanly print hi
NameError:未定义名称“loop”
问题是你把Loop(注大写L)和Loop(注非大写L)放在一起,这样应该可以:
Loop = True while Loop: print ("hi")
你不需要在这里声明变量。你知道吗
while True: print("hi")
问题是你把Loop(注大写L)和Loop(注非大写L)放在一起,这样应该可以:
你不需要在这里声明变量。你知道吗
相关问题 更多 >
编程相关推荐