Test classes.

This commit is contained in:
Captain ALM 2022-11-30 19:26:02 +00:00
parent 5a45ee6aab
commit 5bc4e53553
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

20
main.py
View File

@ -1,3 +1,17 @@
#Lambda
x = lambda a,b:a**b
print(x, type(x), x(2,3))
#Train Class Example
class Train:
def __init__(self, class_, name):
self.class_ = class_
self.name = name
self.name = name if name else "#"
def __str__(self):
return f"Class {self.class_}({self.name})"
class C315(Train):
def __init__(self, name):
#Train.__init__(self, 315, name)
super().__init__(315, name)
c315 = C315("Joe")
print(c315)
del c315