You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
programming-basics-2022/02/main_01.py

19 lines
300 B

def is_prime(n: int) -> bool:
"""
>>> is_prime(10)
True
>>> is_prime(17)
True
>>> is_prime(21)
False
"""
for el in range(2, n):
if n % el == 0:
return False
return True
if __name__ == "__main__":
import doctest
doctest.testmod()