Permalink
Browse files

Added miles to yards conversion capability and added missing

call to miles to feet conversion function
  • Loading branch information...
1 parent 4983ac8 commit 0f8b3da17650a3f20450a3205131f1e45b401f18 Aaron Hill committed Mar 27, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 miles.py
View
@@ -16,6 +16,15 @@ def miles_feet(n):
print str(n) + ' miles = ' + str(b) + ' feet.'
quit()
+def miles_yards(n):
+ b = n * 1760
+ if n == 1:
+ print str(n) + ' mile = ' + str(b) + ' yard(s).'
+ quit()
+ else:
+ print str(n) + ' miles = ' + str(b) + ' yard(s).'
+ quit()
+
def mile():
try:
a = float(raw_input('How many miles would you like to convert? '))
@@ -25,3 +34,7 @@ def mile():
b = raw_input('What you you like to convert to? [I]nches, [F]eet, [Y]ards: ')
if b == "I" or b == "i":
miles_inches(a)
+ if b == 'F' or b == 'f':
+ miles_feet(a)
+ if b == 'Y' or b == 'y':
+ miles_yards(a)

0 comments on commit 0f8b3da

Please sign in to comment.