Skip to content

Instantly share code, notes, and snippets.

View Sadamingh's full-sized avatar

Adam Sadamingh

View GitHub Profile
def my_gcd(a, b):
if b == 0:
return abs(a)
else:
return my_gcd(b, a%b)
# test
my_gcd(0, 0)
my_gcd(1, 1)
my_gcd(12, 8)
def fib(n):
if n == 0 or n == 1:
return n
else:
return fib(n-1) + fib(n-2)
fib(7)
def blast_off(n):
if n == 0:
print("Blastoff 🚀")
else:
print(n)
blast_off(n-1)
blast_off(5)