Ask Question
18 January, 02:51

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.

+3
Answers (1)
  1. 18 January, 02:55
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers