title: Making Pygame Play Sound ONCE
body: <p>I have a small snippet of code which consists of a sound being played once if an if statement is met:</p>
  
  <pre><code>for block in block_list:
      if block.rect.y &gt;= 650 and health &gt;=25 and score &lt; 70:
          player_list.remove(player)
          all_sprites_list.remove(player)
          font = pygame.font.Font("freesansbold.ttf", 30)
          label = font.render("SCORE TARGET NOT MET", 1, YELLOW)
          labelRect = label.get_rect()
          labelRect.center = (400, 250)
  
          error.play()
          laser.stop()
  </code></pre>
  
  <p>However upon playing the 'error' sound, it continues to loop until the pygame window is closed. Is there any way I can edit my code so that the 'error' sound effect is only played once?</p>
  
  <p>Thank you.</p>