Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyPoly
#python 3.6.9 #PyPoly: example of polymorphism and F-strings #this code is created by Rezaul Hoque on April 05,2022 #contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com #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; class Polyex1(): name='ABC' address='road 00, city noville, country nulpart' occupation='xzc' def namad(self): s1=f"""name:{self.name}\naddress:{self.address}""" print(s1) def occu(self): s2=f'occupation:{self.occupation}' print(s2) class Polyex2(): name='XYZ' address="road 0, city Utoville, country zeroland" occupation="fgh" def namad(self): s1=f"""name:{self.name}\naddress:{self.address}""" print(s1) def occu(self): s2=f'occupation:{self.occupation}' print(s2) def display(a): a.namad() a.occu() inst1=Polyex1() inst2=Polyex2() display(inst1) display(inst2)
run
|
edit
|
history
|
help
0
Ваня и забор
E
Calender 2019
Find common characters between two strings
gj
Filtering texts within brackets
kenken1
Python wtf ?
probl2_203700377
pip install pyowm==2.7.1