Skip to main content
Write is_prime(), which returns from inside its loop, then call it in a loop to list the primes up to a limit with a default of 50. Open Lab 27 in the IP Lab Portal

What you will practice

  • Return from inside a loop
  • Use a default parameter value
  • Call your function in a loop

Before you start

Time

20 minutes

Where

IP Lab Portal

Module

Module 10: Defining functions

  • In the IP Lab Portal, open Lab 27 - Prime finder.
  • In class, this lab comes right after the Lesson 4 recap slide in Module 10 core material.