All Courses

TypeError: 'int' object is not subscriptable

By Jennifer, 3 years ago
  • Bookmark
0

name = input("What's your name? ")
age = input ("how old are you? ")
n = 0
int([n[age]])
twentyone = 21 - n
print ("Hi, " + name + " you will be 21 in: " + twentyone + " years.")
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
TypeError: 'int' object is not subscriptable

How to solve this error?

Python
Typeerror
0 Answer
Your Answer

Webinars

More webinars

Related Discussions

Running random forest algorithm with one variable

View More