import os
import time
dollar=(“”"
##########
“”")
Currencies={
“”:dollar,
“USD”:1.0,
“EUR”:0.85,
“EGP”:30.9,
“RMB”:6.5,
}
def clear():
os.system(“cls” if os.name == “nt” else “clear”)
def View_currency_converter():
print(“wlcm currency converter”)
for Currency in Currencies:
print(f"{Currency}: {Currencies[Currency]}")
def Currency_conversion():
clear()
View_currency_converter()
Current_currency = input("choose a currency to convert from: ")
while True:
amount=float(input("Enter the amount: "))
confirmation = input(f"you enterd {amount}{Current_currency}. Confirm? y/n ")
if confirmation== “y”:
break
clear()
View_currency_converter()
to_Currency=input=("What currency do you want to convert to: ").upper()
time.sleep(2)
print(“analyzing your request …please wait”)
time.sleep(2)
print(f"checking for {to_Currency} best rates of available… please wait")
time.sleep(2)
print(f"getting a discount price for {Current_currency} … please waite")
if Current_currency not in Currencies or to_Currency not in Currencies:
print(“invalid… Currency conversion cancelled”)
time.sleep(2)
Currency_conversion()
new_rate=Currencies[to_Currency]/Currencies[Current_currency]
converd_amount= amount*new_rate
clear()
print(f"preparing the deal from {Current_currency} to {to_Currency} please wait…")
time.sleep(2)
print(“stay…”)
time.sleep(2)
print(round(converd_amount,2))
accept = input(“Do you accept transaction?”)
if accept == “y”:
print(“transaction successful”)
else:
print(“transaction cancelled”)
another_conversion = input("do you want another conversion? (y/n): ")
if another_conversion==“y”:
Currency_conversion()
else:
print(“Thank you for using the program…Exit”)
Currency_conversion()