Issues on Control Flow and Looping: "Not all arguments converted in string formatting"


Error: not all arguments converted during string formatting

I don't know why this isn't working. I have looked at other people's code(and admittedly have effectively cheated doing so) trying to work out what the problem is but I can't figure it out. What does "not all arguments converted during string formatting" mean?

a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
for number in a:
    if item % 2 == 0:
        print number


You used number as your loop index (for every number in a). But here, you're using item...but what is item?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.