← Back to challenges

All Numbers in List Are Prime

PythonHardalgebravalidationmath

Instructions

Create a function that takes a list and returns True if every number is prime. Otherwise, return False.

Examples

all_prime([7, 5, 2, 4, 6]) ➞ False

all_prime([2, 3, 5, 7, 13, 17, 19, 23, 29]) ➞ True

all_prime([1, 5, 3]) ➞ False

Notes

1 is not a prime number.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Poker Deck