我想实现让用户输入代码的功能,但是下面的代码运行会出错,想求高手帮我分析下问题出在哪里?谢谢!
months=(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul','Aug','Sep','Oct','Nov','Dec']) str=input('please input a month\n')
for i in months:
if months[i]==str:
print True
months=(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul','Aug','Sep','Oct','Nov','Dec']) str=input('please input a month\n')
for i in months:
if months[i]==str:
print True
2017-08-28
举报