Я пытаюсь сделать простую программу конвертации, но вывод продолжает выходить либо странно, либо вообще ничего. Как я могу это исправить? Вот мой код.
#crypto = [Bitcoin, Ethereum, XRP, Litecoin]
bitcoin = [1, 40.19, 38284.22, 168.73]
ethereum = [.025, 1, 951.99, 4.20]
xrp = [.000026, .001, 1, .003]
litecoin = [.0058, .231, 223.81, 1]
def crypto2Crypto(x,y,w):
if(x == "BE"):
w =+ (y * bitcoin[1])
if(x == "XL"):
y * xrp[3]
if(x == "EB"):
y * ethereum[0]
if(x == "LX"):
y * litecoin[2]
def main():
print("Welcome to the Cryptocurrency exchange!")
conversion = input('"What will you be converting today? B = Bitcoin, E = Ethereum, X = XRP, Litecoin = L. Please give an exchange with the following syntax crypto1crypto2, ex. type "BE" for Bitcoin to Ethereum."')
amountOfCurrency = float(input("How much do you have of " + conversion[0] + " ?"))
w = crypto2Crypto(conversion,amountOfCurrency,0)
print(w)
main()