print ('=======================================')
print("welcome to $$ EXCHANGE RAGHAD  STORE  $$")
print ('=======================================\n')



# exchange rates using nested dictionary
EXCHANGE_RATES = {
    "SAR": {
        "USD": 0.27,
        "EUR": 0.23
    },
    "USD": {
        "SAR": 3.75,
        "EUR": 0.83
    },
    "EUR": {
        "SAR": 4.33,
        "USD": 1.20
    }
}

# Enter the inputs
amount = float(input("Enter the amount you want to convert: "))
exchange_from = input("Enter the currency you want to convert from (SAR, USD, or EUR): ").upper()
exchange_to = input("Enter the currency you want to convert to (SAR, USD, or EUR): ").upper()

# conversion based on user input
if exchange_from == "SAR" and exchange_to == "USD":
    converted_amount = amount * EXCHANGE_RATES["SAR"]["USD"]
elif exchange_from == "SAR" and exchange_to == "EUR":
    converted_amount = amount * EXCHANGE_RATES["SAR"]["EUR"]
elif exchange_from == "USD" and exchange_to == "SAR":
    converted_amount = amount * EXCHANGE_RATES["USD"]["SAR"]
elif exchange_from == "USD" and exchange_to == "EUR":
    converted_amount = amount * EXCHANGE_RATES["USD"]["EUR"]
elif exchange_from == "EUR" and exchange_to == "SAR":
    converted_amount = amount * EXCHANGE_RATES["EUR"]["SAR"]
elif exchange_from == "EUR" and exchange_to == "USD":
    converted_amount = amount * EXCHANGE_RATES["EUR"]["USD"]
elif exchange_from == exchange_to:
    print("Both currencies are the same")
    converted_amount = amount
else:
    print("Invalid exchange currency. Please enter either 'SAR', 'USD', or 'EUR'.")
    exit()
print(f"{amount} {exchange_from}  = {converted_amount} {exchange_to}")

print ('=======================================')
print('Thank you for using Exchange Raghad Store :-)')

