fork download
  1. currency = str(raw_input ("""what currency would you like to covert: GBP, EURO, USD OR YEN?
  2. """))
  3.  
  4.  
  5. exchange = str(raw_input("""what currency would you like in exchange? : GBP, EURO, USD OR YEN?
  6. """))
  7.  
  8. amount = int(input("""how much would you like to convert?
  9. """))
  10.  
  11.  
  12.  
  13. valid_input = ('EUR','eur','GBP','gbp' ,'USD','usd','JPY','jpy')
  14.  
  15. while True:
  16.  
  17. if currency in valid_input and exchange in valid_input:
  18.  
  19. pass
  20.  
  21. else:
  22.  
  23. print("incorrect input, please restart program")
  24. break
  25.  
  26.  
  27. decision = str(raw_input("""Please enter u for user input exchange rate or s for the preset exchange rate
  28. """))
  29.  
  30.  
  31. if decision == "u" :
  32. user_rate = raw_input("Please enter the current exchange rate")
  33.  
  34. exchange_value = int(amount) * int(user_rate)
  35.  
  36. print ("At the user found exchange rate you will receive",exchange_value,exchange)
  37.  
  38.  
  39.  
  40. elif decision == "s" :
  41.  
  42.  
  43. if currency == "GBP" and exchange == "USD":
  44.  
  45. exchange_value= int(amount) * 1.6048
  46.  
  47. print ("At the preset exchange rate you will receive",exchange_value,exchange)
  48.  
  49. if currency == "GBP" and exchange == "EUR":
  50.  
  51. exchange_value= int(amount) * 1.2399
  52.  
  53. print ("At the preset exchange rate you will receive",exchange_value,exchange)
  54.  
  55.  
  56.  
  57.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty