Screenshot
Program
#Function to check the passed number is prime or not
#If prime return true
#Otherwise return false
def isPrime(num):
if num%2!=0 and num%3!=0 and num%5!=0 and
num%7!=0:
return True
else:
return False
#Test cases
print(isPrime(199))
print(isPrime(1099))
print(isPrime(521))
print(isPrime(383))
-----------------------------------------------
Output
True
False
True
True
Get Answers For Free
Most questions answered within 1 hours.