
python2.*.*中用要求输入1或2,如果输入其他如3,a等就exit()的代码怎么写
1个回答
展开全部
x = raw_input('Please input:')
if x not in ('1', '2'):
exit()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
x = raw_input('Please input:')
if x not in ('1', '2'):
exit()
类别
我们会通过消息、邮箱等方式尽快将举报结果通知您。
说明
0/200