Im stuck with the following:
Define a function isPrime(number) that takes in a number as argument and return True if the number is a prime number.
Hint: A number, x is a prime number if it is only divisible by 1 and x itself.
By definition, 1 is not a prime number.
Examples
>>> isPrime(97)
True
>>> isPrime(1)
False
>>> isPrime(-2)
False
# Hint: Step through the range between (2, number-1),
# and determine if the number is divisible using the modulus operator.
def isPrime(x):
how should i go about this? i dont understand it. Any help is appreciated.
p.s the topic this exercise is a part of is 'Conditionals'