Ask Question
31 January, 12:21

Write a Python function isPrime (number) that determines if the integer argument number is prime or not. The function will return a boolean True or False. Next, write a function HowManyPrimes (P), that takes an integer P as argument and returns the number of prime numbers whose value is less than P. And then write a function HighestPrime (K) that takes integer K as an argument and returns the highest prime that is less than or equal to K.

+2
Answers (1)
  1. 31 January, 14:25
    0
    def test_prime (n):

    if (n==1):

    return False

    elif (n==2):

    return True;

    else:

    for x in range (2, n):

    if (n % x==0):

    return False

    return True

    print (test_prime (9))
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a Python function isPrime (number) that determines if the integer argument number is prime or not. The function will return a boolean ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers