diff --git a/week10/akinola/division.md b/week10/akinola/division.md new file mode 100644 index 0000000..bac27c2 --- /dev/null +++ b/week10/akinola/division.md @@ -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. \ No newline at end of file diff --git a/week10/akinola/division.py b/week10/akinola/division.py new file mode 100644 index 0000000..1cfd435 --- /dev/null +++ b/week10/akinola/division.py @@ -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()) \ No newline at end of file