| author | Christopher Burns <chris.d.burns@gmail.com> |
| Tue, 29 Jun 2010 00:30:21 -0500 | |
| branch | scipy2010 |
| changeset 431 | 9126059d6b37 |
| parent 428 | ee689f7c3122 |
| permissions | -rw-r--r-- |
|
64
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
1 |
def gcd(a, b): |
|
428
ee689f7c3122
REF: Minor formatting tweaks in exercise solutions.
Christopher Burns <chris.d.burns@gmail.com>
parents:
64
diff
changeset
|
2 |
if a % b == 0: |
|
ee689f7c3122
REF: Minor formatting tweaks in exercise solutions.
Christopher Burns <chris.d.burns@gmail.com>
parents:
64
diff
changeset
|
3 |
return b |
|
ee689f7c3122
REF: Minor formatting tweaks in exercise solutions.
Christopher Burns <chris.d.burns@gmail.com>
parents:
64
diff
changeset
|
4 |
return gcd(b, a%b) |
|
64
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
5 |
|
|
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
6 |
print gcd(5, 40) |
|
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
7 |
print gcd(11, 60) |
|
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
8 |