Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyMetaParam
#python 3.6.9 #PyMetaParam: Metaclass uses parameters #this code is created by Rezaul Hoque on February01,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; from pprint import pprint class Garden(type): def __new__(cls, Garden, supcls, attrdict, **kwargs): c_ = super().__new__(cls, Garden, supcls, attrdict) if kwargs: for name, value in kwargs.items(): setattr(c_, name, value) return c_ class RoofGard(object, metaclass=Garden, kind='Vegetable', location='Rooftop'): def __init__(self, title,add): self.title = title self.add =add pprint(RoofGard.__dict__) a=RoofGard('The Garden','EastSide Lakefront,NoVille') print(a.title,' is located at ',a.add,'.')
run
|
edit
|
history
|
help
0
Lab_I_4_25_11_2020
Nearest Prime Number
delta5
super and overriding
("Hello,world!")
Faiha Lesson 1, 2020: Python Basics
test3.py
Example for striping string
Character converter
Leibnitz Series To Estimate Pi