Iterable objects are those that implement __iter__ function, which returns an iterator object, i.e. and object providing the functions __iter__ and __next__ and behaving correctly. Usually the size of the iterable object is not known beforehand, and iterable object is not expected to know how long the iterati…
Tag: iterable
‘int’ object is not iterable while using zip in python
Error : Traceback (most recent call last): File “”, line 8, in TypeError: ‘int’ object is not iterable It works when I convert list object to string but not working in int. Answer Because indexing will give back the object and not an iterable container here. unless you call it like thi…
What type of iterable is “x for x in y”?
I’ve been confused of list comprehension in Python, although its shorthand doing for loop is very convenient. I’m not sure if what’s in the join() function’s parameter below is list comprehension since usually you put [] around to show it’s a list comprehension. My question: What…