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


#1



https://www.codecademy.com/en/courses/python-beginner-en-IZ9Ra/0/3?curriculum_id=4f89dab3d788890003000096


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


#2

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


#3

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