Write a function to check weather a number is prime or not
Topic: Write a function to check weather a number is prime or not
Solution
def isprime(num): for i in range(2, num): if num % i == 0: return False return True
List all Python Programs
Solution
def isprime(num): for i in range(2, num): if num % i == 0: return False return True