Guest User

currency converter

a guest
Sep 15th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. print("========== PyConverter / Currency Converter ==========")
  2.  
  3. rates = {'SE': '1.18', 'DS': '0.76', 'DE': '0.89'}
  4. #SE = Sterling > Euro, DS = USD > Sterling, DE = USD > Euro
  5.  
  6.  
  7. print("Type 'SE' for Sterling Pound to Euro;")
  8. print("'DS' for United States Dollar to Sterling Pound;")
  9. print("'DE' for United States Dollar to Euro;")
  10. i = input("Exchange: ")
  11.  
  12. print()
  13.  
  14. def SE():
  15.     print("Sterling to Euro Rate: 1.18")
  16.     y = float(input("Sterling: £"))
  17.     print("£", y, "-> €")
  18.     print('%.2f' % (y*dict['SE']))
  19.  
  20.    
  21. if (i == 'SE'):
  22.     return(SE)
Add Comment
Please, Sign In to add comment