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 ▸

Implement a fibonacci function which calculates the nth number of the fibonacci sequence.


Create an rock, paper, scissors game. The user should input one option, and the computer should play randomly.


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


Firstly, my question is not Python related, but maths A-level related. I don't know how to change that in my profile but I would like to only tutor maths GCSE and potentially A-level. My question: Integrate sin(x)^3 over x=0 and x=pi/2.