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

19
getattr/Kreis_getattr.py Normal file
View File

@@ -0,0 +1,19 @@
from math import pi as pi
class Kreis_getattr:
def __init__(self, radius):
self.radius = radius
self.operators ={
'durchmesser': lambda x: self.radius * 2,
'umfang': lambda x: self.durchmesser * pi,
'flaeche': lambda x: self.radius**2 *pi
}
def __getattr__(self, name):
if name not in self.operators:
raise TypeError(f'unbekannte Operation {name}')
return self.operators[name](0)