Primes Below a Given Number

Published by Harsh Gupta in

Create a function that will find all primes below a given number. Return the result as a list.

Examples

primes_below_num(5) ➞ [2, 3, 5]

primes_below_num(10) ➞ [2, 3, 5, 7]

primes_below_num(20) ➞ [2, 3, 5, 7, 11, 13, 17, 19]

Notes

If n is a prime, include it in the list.

Watch a quick demo on how Edabit works.