int object is not subscriptable in python

Solutions on MaxInterview for int object is not subscriptable in python by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "int object is not subscriptable in python"
Emmanuel
21 Jun 2016
1"""
2This error means the variable you want to subscript is an integer.
3
4if you want to subscript an int, a way of doing that is turning it to str.
5"""
6num = 1234
7x = num[2]  # does not work
8x = int(str(num)[2])  # works, x = 3