1
0

exchange rate discovery object.

This commit is contained in:
Amir Taaki
2012-06-30 13:47:08 +02:00
parent b21d08c0af
commit 02d8d297dc
2 changed files with 17 additions and 1 deletions

14
lib/exchange_rate.py Normal file
View File

@@ -0,0 +1,14 @@
class Exchanger:
def __init__(self, quote_currencies):
self.quote_currencies = quote_currencies
def exchange(self, btc_amount, quote_currency):
assert quote_currency in self.quote_currencies
return btc_amount * 6
if __name__ == "__main__":
exch = Exchanger(("EUR", "USD", "GBP"))
print exch.exchange(1, "EUR")