add() argument after * must be an iterable, not Setting pygame编写小游戏时报错

用pygame编写程序时报错,小白求大佬们指点,在线等!!
def check_keydown_events(event,ai_settings,screen,ship,bullets):
"""响应按键"""
if event.key == pygame.K_RIGHT:
ship.moving_right = True
if event.key == pygame.K_LEFT:
ship.moving_left = True
elif event.key == pygame.K_SPACE:
new_bullet = Bullet(ai_settings,screen,ship)
bullets.add(new_bullet)

            File "E:\python\aline_invasion\game_functions.py", line 26, in check_events
check_keydown_events(event,ai_settings,screen,ship,bullets)

File "E:\python\aline_invasion\game_functions.py", line 11, in check_keydown_events
new_bullet = Bullet(ai_settings,screen,ship)
File "E:\python\venv\lib\site-packages\pygame\sprite.py", line 124, in init
self.add(*groups)
File "E:\python\venv\lib\site-packages\pygame\sprite.py", line 142, in add
self.add(*group)
TypeError: add() argument after * must be an iterable, not Setting

是不是《python从入门到实践》这本书上的Alien invasion小游戏?我也是编写这个游戏的时候遇到错误了,蹲个大佬解答

是不是你的类没有继承Sprite啊,bullet类继承sprite试试

https://stackoverflow.com/questions/38165126/arguments-not-being-passed-through-render-argument-after-must-be-an-iterable

我也出错。参数错?参数应该是个列表?改成self.bullets.add([new_bullet])也不行。
def _fire_bullet(self):
new_bullet=Bullet(self)
# new_bullet.add(self.bullets)
self.bullets.add(new_bullet)
出错提示:
File "D:/Python_My/Python_Ship/alien_invasion.py", line 48, in _fire_bullet
new_bullet=Bullet(self)
File "D:\Python_My\Python_Ship\venv\lib\site-packages\pygame\sprite.py", line 116, in init
self.add(*groups)
File "D:\Python_My\Python_Ship\venv\lib\site-packages\pygame\sprite.py", line 134, in add
self.add(*group)
TypeError: add() argument after * must be an iterable, not AlienInvasion

class Bullet(Sprite): def init(self,ai_game):少写了一个“_”线。

super().init() 初始化时写成了int,要改成init