Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyTypeClass
#python 3.6.9 #PyTypeClass #this code is created by Rezaul Hoque on January 24,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_body = """ def __init__(self, gard, location): self.gard = gard self.location = location def detail(self): return f'There is a {self.gard}.It is on {self.location}.' """ class_dict = {} exec(class_body, globals(), class_dict) Garden = type('Garden', (object,), class_dict) print(isinstance(Garden, type)) g=Garden('Garden','Backyard') print(g.__dict__) print(Garden.__dict__)
run
|
edit
|
history
|
help
0
147
My code 4
Q3
binary_search_in_python
EJ2_PYTHON_20.321.212-7
Binary number into Decimal
shuru11
binarySearch.py
Ej2_python_204676887
Guessing game