Skip to main content

Posts

Showing posts with the label The Crazy Programmer Solve TypeError: ‘int’ object is not iterable in Python Solve TypeError: ‘int’ object is not iterable in Python The Crazy Programmer

Solve TypeError: ‘int’ object is not iterable in Python Gorakh Gupta The Crazy Programmer

Whenever we are writing any programs and then we encounter any error. The amount of frustration we got at that time is so much higher. So I have got a solution for you. Today in this article we are going to discuss the error typeerror: ‘int’ object is not iterable. We will discuss why we get this error and what are some possible solutions for this error. Please make sure to read till the end to save a lot of time in debugging this error. First, let’s understand what the term ‘iterable’ means? Iterable is something from which we can take values one by one and use them accordingly. For example whenever we are using a loop to iterate over a list or over a tuple then the loop is working as an iterable. It gives a single element at a time to process it. In other terms, you can think of iterable as a container from which we get a single item at a time. And it will give the items as instructed. For example: for i in range(5): print(i) when we run this code in the terminal we get t