Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions week10/akinola/division.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Division
Have the function Division(num1,num2) take both parameters being passed and return the Greatest Common Factor. That is, return the greatest number that evenly goes into both numbers with no remainder. For example: 12 and 16 both are divisible by 1, 2, and 4 so the output should be 4. The range for both parameters will be from 1 to 10^3.
10 changes: 10 additions & 0 deletions week10/akinola/division.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def Division(num1,num2):
while num1 != 0 and num2 != 0:
if num1 > num2:
num1 = num1 % num2
else:
num2 = num2 % num1
return (num1 + num2)

# keep this function call here
print Division(raw_input())