Guest User

Untitled

a guest
Jun 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. class Person(object):
  4. """Legt eine Person an"""
  5. def eingabe(self, vorname, name, alter):
  6. """Legt eine Person an"""
  7. self.vorname = vorname
  8. self.name = name
  9. self.alter = alter
  10.  
  11. print '(Person wurde erfolgreich initialisiert)'
  12. print '%s, %s, ("%s")' % (self.vorname, self.name, self.alter),
  13.  
  14. p = Person('Sascha', 'Siegel', 24)
  15.  
  16. personen = [p]
  17.  
  18.  
  19. /pythonuebung1.py
  20. Traceback (most recent call last):
  21. File "./pythonuebung1.py", line 14, in <module>
  22. p = Person('Sascha', 'Siegel', 24)
  23. TypeError: default __new__ takes no parameters
Add Comment
Please, Sign In to add comment