Typo korrigiert.

This commit is contained in:
2024-11-09 16:58:16 +01:00
parent ea14cde427
commit 060c235e3f
6 changed files with 0 additions and 0 deletions

17
getattr/name.py Normal file
View File

@@ -0,0 +1,17 @@
class Name:
def __init__(self,vorname,name):
self.vorname = vorname
self.name = name
def __getattr__(self,attr):
if attr == 'fullname':
return self.vorname + ' ' + self.name
elif attr == 'sortname':
return self.name + ',' + self.vorname
else:
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{attr}'")