Raspithek
2 years ago
5 changed files with 35 additions and 0 deletions
@ -0,0 +1,5 @@ |
|||||
|
class Person: |
||||
|
# Konstruktor |
||||
|
def __init__(self,vorname, name): |
||||
|
self.vorname = vorname |
||||
|
self.name = name |
@ -0,0 +1,9 @@ |
|||||
|
class Telefonnummer: |
||||
|
|
||||
|
def __init__(self, lkz, vorwahl, nummer): |
||||
|
self.lkz = lkz |
||||
|
self. vorwahl = vorwahl |
||||
|
self.nummer = nummer |
||||
|
|
||||
|
def __str__(self): |
||||
|
return f'+{self.lkz}-{self.vorwahl}/{self.nummer}' |
@ -0,0 +1,5 @@ |
|||||
|
from . import Telefonnummer |
||||
|
from . import Person |
||||
|
|
||||
|
__all__ = ['telefonnnummer','person','anschrift'] |
||||
|
|
@ -0,0 +1,9 @@ |
|||||
|
class Anschrift: |
||||
|
def __init__(self, strasse, hausnummer, plz, ort): |
||||
|
self.strasse = strasse |
||||
|
self.hausnummer = hausnummer |
||||
|
self.plz = plz |
||||
|
self.ort = ort |
||||
|
|
||||
|
def __str__(self): |
||||
|
return self.strasse + ' ' + self.hausnummer + '\n' + self.plz + ' ' + self.ort |
@ -0,0 +1,7 @@ |
|||||
|
from partner.Telefonnummer import Telefonnummer |
||||
|
from partner.Person import Person |
||||
|
|
||||
|
p= Person('Homer','Simpson') |
||||
|
tel = Telefonnummer('44','221','12345678') |
||||
|
|
||||
|
print(str(tel)) |
Loading…
Reference in new issue