What does it mean to say if n
? I don't get why if n
works in an if statement. Shouldn't there be an argument such as if n == 0
or something, not just if n
?
def AddMusicAtPosition(self, newMusic, n):
if n:
self.nextMusic.AddMusicAtPosition(newMusic, n - 1)
else:
newMusic.nextMusic = self.nextMusic
self.nextMusic = newMusic
Aucun commentaire:
Enregistrer un commentaire