- Code: Select all
`print ("Welcome to your USD Currency Converter!")`

g = input("How much money (USD) are you trying to convert? ")

## input is g. g= ammount to be converted in USD#

print ("Please choose from the following options:")

print (" '1' Convert from US Dollars to Euro")

print (" '2' Convert from US Dollars to Mexican Pasos")

print (" '3' Convert from US Dollars to Japanese Yen")

print (" '4' Convert from US Dollars to Canadian Dollars")

print (" '5' Convert from US Dollars to Chinese Yuan")

print (" '0' Return to the main Menu")

g = input()

choice = int(g)

eu_euros = int(g)*.74 #euro equation#

m_pas = int(g)*13.14 # paso equation#

j_yen = int(g)*97.76 # yen equation#

c_can = int(g)*1.03 # canadian dollar equation (c/d = canadian dollar)#

c_yua = int(g)*6.12 # yuan equation#

if choice == 1: # euro process#

def us_to_euro(eu_euros):

return .74*input(eu_euros)

if choice == 2: # paso process#

def us_to_pasos(m_pas):

return 13.14*input(m_pas)

if choice == 3: # yen process#

def us_to_yen(j_yen):

return 97.76*input(j_yen)

if choice == 4: # c/d process#

def us_to_canadian(c_can):

return 1.03*input(eu_euros)

if choice == 5: # yuan process#

def us_to_yuan(c_yua):

return 6.12*input(c_yua)

if choice == 1: #printing results: euro#

print ("Euros: ",eu_euros)

if choice == 2: #printing results: paso#

print ("Pasos: ",m_pas)

if choice == 3: #printing results: yen#

print ("Yen: ",j_yen)

if choice == 4: #printing results: c/d#

print ("Canadian Dollars: ",c_can)

if choice == 5: #printing results: yuan#

print ("Chinese Yuan: ",c_yua)

this is my current code. i'm trying to make it return to the main menu when i press the button "0". and also loop when the task has completed.

thanks!