These transactions may affect the price of the underlying currency, and consequently, your cost or proceeds. These transactions will be designed to be reasonable in relation to the risks associated with the potential transaction with you. Such activities may include trading ahead of order execution. In connection with our market making and other activities, we may engage in hedging, including pre-hedging, to mitigate our risk, facilitate customer transactions and hedge any associated exposure. The level of the fee or markup may differ for each customer and may differ for the same customer depending on the method or venue used for transaction execution. The price provided may include profit, fees, costs, charges or other mark ups as determined by us in our sole discretion. We provide all-in pricing for exchange rates. The exchange rate you are offered may be different from, and likely inferior to, the rate paid by us to acquire the underlying currency. Exchange rates offered by other dealers or shown at other sources by us or other dealers (including online sources) may be different from our exchange rates. You acknowledge that exchange rates for retail and commercial transactions, and for transactions effected after regular business hours and on weekends, are different from the exchange rates for large inter-bank transactions effected during the business day, as may be reported in The Wall Street Journal or elsewhere. If we assign an exchange rate to your foreign exchange transaction, that exchange rate will be determined by us in our sole discretion based upon such factors as we determine relevant, including without limitation, market conditions, exchange rates charged by other parties, our desired rate of return, market risk, credit risk and other market, economic and business factors, and is subject to change at any time without notice. Print "You must pick either dollar, euro or yen.1Exchange rates fluctuate, at times significantly, and you acknowledge and accept all risks that may result from such fluctuations. print "Pound Sterling converter"Ĭonvert_to = raw_input("What currency do you want to convert to? ")Īmount = int(raw_input("How much would you like to convert? ")) Also, you must change this line amount = input("How much would you like to convert? ") to this amount = int(input("How much would you like to convert? ")), so you can get the input as an integer and not a string. Instead of using a variable just say convert_to = "dollars", and so on for the other choices. Just change what you're comparing to to a string. The input() function returns a string, so this: Your code is not working because you're assuming that the input() function returns an integer. So on your if statements, you can just compare them to the specific strings, as: if convert_to = "dollars": These are the changes necessary for the code to run.Įxtra: You also don't need the variables in this case, since you're only using them in one field. Because the comparsion to the dollar is hapening first, it always goes to that case. And since the initial values for all the variable are 0, the if statements returns true when comparing convert_to to dollar, euro or yen. If you try to pass a string to a input variable it will always return 0. So change convert_to to: convert_to = raw_input ("What currency do you want to convert to? ") Then change the input type for raw_input, as python requires this type of input to recognize a String input. If the input is a string such as "dollar", "euro" or "yen", the variables need to be changed to these respective strings, so firstly you need to set the variable as: dollar = "dollar" Changing that, the version with integer input will work. So you need to change the initial values of dollar, euro and yen. If i understand correctly, the user will input either "0", "1" or "2" as a input, for the convertion for dollar, euro or yen respectively. The program brings up a "input not defined" error instead of printing "You must pick either dollar, euro or yen." The numbers they are being multiplied by are simply the conversion rates from pounds.Īlso, a side note but less important one, the final else part does not work. Instead of seeing what convert_to is, it goes through the convert_to = dollar part regardless of if you type euro or yen. When I run the program, the if statement does not work correctly. All I want this program to do is have the user choose a currency (convert_to) and then choose how much they want to convert (amount) and then the program will convert it for them. I'm a beginner in Python, as you can probably tell. Print "You must pick either dollar, euro or yen." Print "You can convert pounds to either dollars, euros or yen"Ĭonvert_to = input ("What currency do you want to convert to? ")Īmount = input("How much would you like to convert? ")
0 Comments
Leave a Reply. |