Skip to content

Commit

Permalink
Added meters to decimeters conversion capability
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Hill committed Apr 19, 2012
1 parent d8085f7 commit f15b5dd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions meters.py
Expand Up @@ -16,6 +16,15 @@ def meters_centimeters(n):
print str(n) + ' meters = ' + str(b) + ' centimeter(s)'
quit()

def meters_decimeters(n):
b = float(n) * 10
if float(n) == 1:
print str(n) + ' meter = ' + str(b) + 'decimeter(s).'
quit()
else:
print str(n) + ' meters = ' + str(b) + ' decimeter(s)'
quit()

def meter():
try:
a = float(raw_input('How many meters would you like to convert? '))
Expand All @@ -27,5 +36,7 @@ def meter():
meters_millimeters(a)
elif b == 'C' or b == 'c':
meters_centimeters(a)
elif b == 'D' or b == 'd':
meters_decimeters(a)
else:
print 'That unit is not available yet!'

0 comments on commit f15b5dd

Please sign in to comment.