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
LinkedList implementation
Lesson#6
Lakshya
Homework exercise
Bubble sort
DISPLAY
shivareddy correct
PyList
sai exc 1
fb_series