Answer:
def to_euro(dollar):
return float(dollar)*0.81;
def to_yen(dollar):
return float(dollar)*106.45;
def to_peso(dollar):
return float(dollar)*18.58;
def main():
while(1):
x=input("Enter 1 for Euro, 2 for Japanese Yen, 3 for Mexican Peso: ");
x=int(x);
if(x==1 or x==2 or x==3):
break;
else:
print("Error: Invalid choice");
while(1):
y=input("Enter US Dollar: ");
y=float(y);
if(y<0):
print("Can't be negetive");
else:
break;
if(x==1):
print("Its is converted to ",to_euro(y)," Euro" );
elif(x==2):
print("Its is converted to ",to_yen(y)," Yen" );
else:
print("Its is converted to ",to_peso(y)," Peso" );
main()
Step-by-step explanation: