我正在尝试一段简单的代码,得到别人的名字和年龄,让他/她知道他们什么时候年满21岁......不考虑否定和所有这些,只是随机的.
我一直收到这个'int' object is not subscriptable错误.
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."
Run Code Online (Sandbox Code Playgroud)