Commit 1201fe23 by BellCodeEditor

auto save

parent b5c6bbbe
Showing with 14 additions and 0 deletions
def gcd_stu(a,b):
if a < b:
a,b = b,a
result = [i for i in range(1,b+1) if b%i == 0 and a %i == 0]
return result.pop()
def gcd_teacher(a,b):
if a < b:
a,b = b,a
return a if b == 0 else gcd_teacher(b,a%b)
print(gcd_stu(1234234 ,13423428))
print(gcd_teacher(21,210))
\ No newline at end of file
print("hello world!")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment