Test classes.
This commit is contained in:
parent
5a45ee6aab
commit
5bc4e53553
20
main.py
20
main.py
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user