Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class klasse:
- def __init__(self, vorname, name, x, y):
- self.vorname = vorname
- self.name = name
- self.data_x = x
- self.data_y = y
- def main():
- liste = []
- person_1 = klasse('Musterman', 'Max', [42, 23], [1, 2, 3])
- person_2 = klasse('Müller', 'Tom', [32, 54], [3, 2, 1])
- liste.append(person_1.__dict__)
- liste.append(person_2.__dict__)
- # liste.append([attr for attr in dir(person_1) if not callable(getattr(person_1, attr)) and not attr.startswith("__")])
- # liste.append([attr for attr in dir(person_2) if not callable(getattr(person_2, attr)) and not attr.startswith("__")])
- print(liste)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment