Jun-17-2020, 09:33 AM
It appears that
elem
is a list datatype because it is iterable. The fact that you are identifying elements by position suggests to Python iterability, thus it attempts to reference it as such. Since takeFirst(...)
is a function, the assumption is that elem
is defined somewhere (by assignment) upon its first use as a variable before being passed.