Skip to content

Instantly share code, notes, and snippets.

@soyHouston256
Last active November 2, 2020 16:09
Show Gist options
  • Select an option

  • Save soyHouston256/5212401b9d908df18aea4fca09e530f6 to your computer and use it in GitHub Desktop.

Select an option

Save soyHouston256/5212401b9d908df18aea4fca09e530f6 to your computer and use it in GitHub Desktop.
menu = """
Bienvenido al conversor de monedas
1.- Soles Peruanos
2.- Pesos Mexicanso
3.- Pesos Argentinos
Elige una opcion: """
opcion = input(menu)
def conversor(moneda,valor):
monto = input("Cuantos "+moneda+" tienes?: ")
moneda = moneda
cantidad = float(monto) / valor
cantidad = round(cantidad,2)
return "Tus "+str(monto)+" "+moneda+" equivalen a " + str(cantidad) + " dolares"
if opcion == "1":
print(conversor("Soles",float(3.69)))
elif opcion == "2":
print(conversor("Pesos Mexicanos",float(18.90)))
elif opcion == "3":
print(conversor("Pesos Argentinos",float(12.90)))
else:
print("Ingrese una opcion valida")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment