小白一个,该如何正确使用while循环
n_ew = input('RUN and STOP : ')if n_ew == 'RUN':
r_un = True
else:
print 'Game over'
while r_un:
i = raw_input('number: ')
if i == 'quit':
break
else:
k = input ('k = ')
for j in range(k):
print j
continue
print 'Game over'
用PYcharm测试时一直报:
RUN and STOP : RUN
Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/2.2.py", line 1, in <module>
n_ew = input('RUN and STOP : ')
File "<string>", line 1, in <module>
NameError: name 'RUN' is not defined
该如何定义 RUN