Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyDIP
#python 3.6.9 #PyDIP #this code is created by Rezaul Hoque on January 20,2022;contact: jewelmrh@yahoo.com,Dhaka, Bangladesh #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; from abc import ABC class Converter(ABC): def exchange(self, from_currency, to_currency, amount) -> float: pass class Exchanger1(Converter): def exchange(self, from_currency, to_currency, amount) -> float: print('Converting US Dollar into Tk') print(f'{amount} {from_currency} = {amount *83} {to_currency}') return amount * 83 class Exchanger2(Converter): def exchange(self, from_currency, to_currency, amount) -> float: print('Converting US Dollar into Taka') print(f'{amount} {from_currency} = {amount * 82} {to_currency}') return amount * 82 class Screen: def __init__(self, conv: Converter): self.conv= conv def start(self): self.conv.exchange('USD', 'Tk', 100) if __name__ == '__main__': exch= Exchanger1() screen = Screen(exch) screen.start()
run
|
edit
|
history
|
help
0
Brother's share
Pytest
linked_lists_2+decisions
PyRegCapGroup
display age
linearSearch.py
Leibnitz Series To Estimate Pi
Hello wold Happy
26.09.2018
Python, finditer(), filter emails and place put in tuple