Python TypeError: 'int' object is not iterable - ItsMyCode
itsmycode.com › python-typeerror-int-object-is-notNov 24, 2021 · In Python, unlike lists, integers are not directly iterable as they hold a single integer value and do not contain the ‘__iter__‘ method; that’s why you get a TypeError. You can run the below command to check whether an object is iterable or not. print (dir (int)) print (dir (list)) print (dir (dict)) If you look at the output screenshots, int does not have the ‘__iter__’ method, whereas the list and dict have the '__iter__' method.