Question: Write, test and debug a function called isPrime that takes a positive whole number, n , as its single parameter and returns True if n
Write, test and debug a function called isPrime that takes a positive whole number, n as its single parameter and returns True if n is a prime number and returns False if it is not. A prime number is a whole number that is divisible by no numbers other than and itself Note that is not a prime number. Try implementing this with a while loop and with a for loop.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
