Question: Write a function called next_prime that takes a scalar positive integer input n. Use a while-loop to find and return k, the smallest prime number
Write a function called next_prime that takes a scalar positive integer input n. Use a while-loop to find and return k, the smallest prime number that is greater than n. Feel free to use the built-in isprime function (do not use nextprime).
Step by Step Solution
3.36 Rating (146 Votes )
There are 3 Steps involved in it
Lets go through this stepbystep to write the nextprime function in a programming language like Pytho... View full answer
Get step-by-step solutions from verified subject matter experts
