首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Error: 'int' object is not subscriptable怎么办?

Error: 'int' object is not subscriptable怎么办?

提问于 2018-01-26 04:04:11
回答 2关注 0查看 9K

我使用一个简单的代码,找到一个人的名字和年龄,

单我不断收到这个'int' object is not subscriptable错误。

代码语言:javascript
复制
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."
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档