Skip to content
Browse files

Added meters to decimeters conversion capability

  • Loading branch information...
1 parent d8085f7 commit f15b5ddc4b4294324ec585f42a63ca0f7127de20 Aaron Hill committed Apr 19, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 meters.py
View
11 meters.py
@@ -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? '))
@@ -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.
Something went wrong with that request. Please try again.