社区首页 >问答首页 >Error: 'int' object is not subscriptable怎么办?
问Error: 'int' object is not subscriptable怎么办?
提问于 2018-01-26 04:06:22
回答 2关注 0查看 381
使用一个代码,找到一个人的名字和年龄,
代码语言:javascript
代码运行次数:0
复制
name1 = raw_input("What's your name? ")
age1 = raw_input ("how old are you? ")
x = 0
int([x[age1]])
twentyone = 21 - x
print "Hi, " + name1+ " you will be 21 in: " + twentyone + " years."