[Solved] TypeError: ‘int’ object is not iterable; Python 2.7

[ad_1]

num is an integer, and list() expects an iterable, hence the error. Did you want to obtain a list of integers representing the digits of num? If so you can try using map():

l = map(int, string)

[ad_2]

solved TypeError: ‘int’ object is not iterable; Python 2.7