Stuck, here's what I have thus far. def calculate_meters(meters): meters = int(input('Enter Feet: ')) meters = (meters * 0.3048) meters = round(meters,2) return meters def calculate_feet(feet): feet = int(input('Enter meters: ')) feet = (feet / 0.3048) feet = round(feet,2) return feet print('Feet and Meters Converter') def mainmenu(): while True: print('Feet and Meters Converter') print() print('Conversions Menu:') print('a. Feet to Meters') print('b. Meters to Feet') choice = str(input('Select a conversion (a/b):')) print() if choice == 'a': calculate_meters() choice2 = str(input('Would you like to perform another conversion? (y/n): ')) while choice2 == 'y': pass if choice == 'b': calculate_feet() choice2 = str(input('Would you like to perform another conversion? (y/n): ')) while choice2 == 'n': print('Thanks, bye!') break
Stuck, here's what I have thus far.
def calculate_meters(meters):
meters = int(input('Enter Feet: '))
meters = (meters * 0.3048)
meters = round(meters,2)
return meters
def calculate_feet(feet):
feet = int(input('Enter meters: '))
feet = (feet / 0.3048)
feet = round(feet,2)
return feet
print('Feet and Meters Converter')
def mainmenu():
while True:
print('Feet and Meters Converter')
print()
print('Conversions Menu:')
print('a. Feet to Meters')
print('b. Meters to Feet')
choice = str(input('Select a conversion (a/b):'))
print()
if choice == 'a':
calculate_meters()
choice2 = str(input('Would you like to perform another conversion? (y/n): '))
while choice2 == 'y':
pass
if choice == 'b':
calculate_feet()
choice2 = str(input('Would you like to perform another conversion? (y/n): '))
while choice2 == 'n':
print('Thanks, bye!')
break
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images