Answers for "list object attributes python"

0

see attributes of object python

>>> class new_class():
...   def __init__(self, number):
...     self.multi = int(number) * 2
...     self.str = str(number)
... 
>>> a = new_class(2)
>>> a.__dict__
{'multi': 4, 'str': '2'}
>>> a.__dict__.keys()
dict_keys(['multi', 'str'])
Posted by: Guest on December-11-2020
0

list object attributes python

rofl = NewObject()
dir(rofl) // <-- show all available attributes that object has
Posted by: Guest on June-22-2021

Code answers related to "list object attributes python"

Python Answers by Framework

Browse Popular Code Answers by Language