β back to unit
Challenge
# puzzle gauntlet advanced
The Prime Guest List
The mathematician's party invites ONLY primes. Write out the guest list up to n. π
You get n. Print every prime from 2 to n, space-separated (or none if n is below 2). You just built a prime detector β promote it to a function and let it work.
Example:
Input: n = 20
Output: 2 3 5 7 11 13 17 19
Testing every number from 2 to 20 with the prime detector keeps only the ones with no smaller divisor.
π‘ need a hint?
pg-prime-guest-list.pyπ given lines are locked β write your code in between
loading...