diff options
Diffstat (limited to 'test/3-1.py')
-rw-r--r-- | test/3-1.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/3-1.py b/test/3-1.py new file mode 100644 index 0000000..95d2fbe --- /dev/null +++ b/test/3-1.py @@ -0,0 +1,14 @@ + +def prime_num(num, div): + if (num >=1): + if (div*div <= num/2): + if (num % div) == 0: + return False + else: + return prime_num(num,div+1) + else: + return True + else: + return False + +print(prime_num(29,2)) |