-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcfunction2.py
More file actions
29 lines (21 loc) · 892 Bytes
/
Copy pathcfunction2.py
File metadata and controls
29 lines (21 loc) · 892 Bytes
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
from cfunctions import cfunctions
class cfunctions2 (cfunctions):
def __init__(self, name):
super().__init__(name) # provides the parameters required by the init function of the parent class
self.name = name
self.count = 0
cfunctions2.count = 0
def listHobbies ( self, *hobbies ) :
print (self.name)
for hobby in hobbies :
print ( 'Your Hobby is', hobby)
def calcPrice (self, area):
sqm_price = 15
carpetprice = area * sqm_price * 2.5
return sqm_price, carpetprice
def countquotesCustomer ( self ): ## 2 different
self.count +=1
return self.count
def countquotesAll ( self ): ## both object will access this variables
cfunctions2.count +=1
return cfunctions2.count