第一天学python,想随便写个代码,不能运行,麻烦大家看看.
python吧
全部回复
仅看楼主
level 2
alexzhujun 楼主
麻烦大家看看哪里错了?谢谢。。。第一天学。。。好烦躁。
age=input('please enter your age')
if age>18
print('good')
else:
print('本APP仅限18岁以上使用')
2019年04月02日 11点04分 1
level 12
你过两天再看看这个问题,就会了
2019年04月02日 11点04分 2
level 6
if age>18:
2019年04月02日 11点04分 3
level 5
仔细看,你这么明显的错误
2019年04月02日 13点04分 4
level 3
age数据类型错了,换成整形[黑线]
2019年04月02日 16点04分 5
level 3
还有条件那里也错了,就是3楼所说的
2019年04月02日 16点04分 6
level 11
楼上说的没错
2019年04月02日 22点04分 7
level 1
age为字符串,要转化为整型才能比较大小
2019年04月02日 23点04分 8
level 6
用户输入是字符串形式,用eval函数转化为数值就可以了
2019年04月03日 00点04分 9
level 5
先玩几天,再看看,就知道了
2019年04月04日 08点04分 10
level 6
int(age) 输入是字符串。。。。得转型
2019年04月04日 09点04分 11
level 4
18之后的冒号呢?
2019年04月04日 10点04分 12
level 3
input输入的是字符串 转换成整数类型
2019年04月04日 10点04分 13
level 5
18后加冒号,还有在input写入int()中就好了!
2019年04月04日 10点04分 14
level 2
你输入的是数字,必须要转化,int(input()),其次,if后面需要冒号,最后注意缩进
2019年04月04日 12点04分 15
1 2 尾页