Write a function that checks whether a number is prime or not.

Depending on the student level I would accept a simple answer such as: (cannot format code) or expect a more complex answer with optimization such as sieve of Eratosthenes

AC

Related Python Mentoring answers

All answers ▸

Manually implement a function that finds the smallest value in a list of integers and print it.


Create a program that takes in two numbers and returns the highest of the two


What is the difference between a cycle "if" and "while"?


Write a basic program to output the lowest of 3 input numbers. (You may omit error checks on your inputs)