Skip to content
Advertisement

TypeError: argument 1 must be pygame.Surface, not list – Its not a list

I’ve been following the python flappy bird ai tutorial from techwithtim, and I get this error;

JavaScript

My code is like this

JavaScript

I read the other posts with the same problem and I understand it, but BG_IMG is not a list like BIRD_IMGS. I don’t know what to do.

I tried doing BG_IMGS[0] to get the first image of the “list” but it says the object is not a list. Why?

Advertisement

Answer

[i1], [i2], [i3] is not the same as [i1, i2, i3]

The following is not a list, but a tuple with 3 components, where each component is a list with 1 element:

JavaScript

Change it:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement