You can download this code by clicking the button below.
This code is now available for download.
Determine if an integer is a prime number. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.
Technology Stack : Built-in functions
Code Type : Function
Code Difficulty : Beginner
def a_is_prime(n):
if n <= 1:
return False
for i in range(2, int(n**0.5) + 1):
if n % i == 0:
return False
return True