Error: ‘int’ object is not subscriptable – Python | int object is not subscriptable
The problem is in the line,
int([x[age1]])
What you want is
x = int(age1)
You also need to convert the int to a string for the output…
print “Hi, ” + name1+ ” you will be 21 in: ” + str(twentyone) + ” years.”