PASS DEMO: In this lesson you'll use toolkit tools with code that includes a pass statement. So what is pass?

pass is a Python command that literally does nothing! It is often used as placeholder code to prevent an error.

  • Follow along with the demo to see how pass helps prevent an error. When can we remove pass?
  • Find the pass indented in the function and delete it! Make sure that the other code stays indented.
  • Click Run to see the program work. Click Submit and Next when you're ready to move on.

stage.set_background("space") sprite = codesters.Sprite("ufo") def hyper_speed(): pass rand_x = random.randint(-225, 225) rand_y = random.randint(-225, 225) rand_speed = random.randint(5, 15) sprite.set_speed(rand_speed) sprite.glide_to(rand_x, rand_y) hyper_speed() hyper_speed() hyper_speed()