-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathday8classes.py
71 lines (50 loc) · 1.49 KB
/
day8classes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
def somethingElse():
pass
class Base:
"""This is the Base class to rule all classes"""
someVar = "Some shared value"
def __init__(self,id='',desc='No Description'):
print("Base class init fx")
self.id = id
self.address = ''
self.description = desc
self.data = dict()
def doSomething(self,someValue):
"""This is the do something function\n
input: someValue [Should be a string]\n
output: Garbage print of lalalala
"""
self.somethingElse()
return f"Doing something with {someValue} from {self.id}"
def somethingElse(self):
print("Lalalala")
def __str__(self):
return f"This is Base object id: {self.id}"
class Child(Base):
def __init__(self):
super().__init__("whatever","something")
print("Child class init fx")
def advFx(self):
return "This is an added functionality"
class OtherChild(Base):
pass
class Person:
name = ""
age = 0
id = ''
from tikiClass import Tiki
Tiki().stayAtHome()
# miklasObj = Child()
# # miklasObj.doSomething('child stuff')
# print(miklasObj.advFx())
# tikiObj = Base(desc='Whatever',id='tiki123')
# lorenzoObj = Base("lorenzo23","Lorenzo is suave")
# print(tikiObj.doSomething(42))
# print(tikiObj)
# print(tikiObj.someVar)
# tikiObj.someVar = "Dangit! Tiki changed the value"
# print(tikiObj.someVar)
# print(lorenzoObj.someVar)
# print(tikiObj.id)
# print(tikiObj.description)
# print(lorenzoObj.id)