擅长:python、mysql、java
<p>在Python3.x中,您的代码可以正常工作</p>
<p>但是如果您使用的是python 2,则必须使用raw_input()输入字符串</p>
<blockquote>
<pre><code>while True:
s = raw_input('Enter something : ')
if s == 'quit':
break
print('Length of the string is', len(s))
print('Done')
</code></pre>
</blockquote>