Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyNewInit
#python 3.6.9 #PyNewInit #this code is created by Rezaul Hoque on January 23,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; class Garden: def __new__(cls, garden, location): # create a new object obj = super().__new__(cls) # initialize attributes obj.garden = garden obj.location = location # inject new attribute obj.garden = f'{garden}' return obj g = Garden('Garden', 'Backyard') print(g.garden) print(g.__dict__)
run
|
edit
|
history
|
help
0
Metric failed
Love
Calender 2019
Variables mutables e inmutables
Print lists separated by comma
benda x guna
find minimum in right sorted array
My Intro
Q5
Calculate Volume of Sphere