while True:
input = raw_input('请输入: ')
try:
input = int(input)
if input%2 == 0:
print input," 是偶数:"
else:
print input," 是奇数:"
except:
input = str(input)
if not ' ' in input:
print input,"是字符串,长度为:",len(input)
else:
print input,"是一句子,共有",input.count(' '),"个空格!"
现在按回车键,默认是”0字符串“。一直让你输入,退出不了。除非关闭窗口,有没有内部停止的方法呀?