File tree 1 file changed +52
-0
lines changed
Module3_OOPs_Key_Concepts_in_Python
1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ class Customer :
2
+ title = ""
3
+ fname = ""
4
+ lname = ""
5
+ isblacklisted = 0 ;
6
+
7
+ def __init__ (self ):
8
+ self .title = ""
9
+
10
+ def __str__ (self ):
11
+ return "Title:" + self .title + " First Name:" + self .fname + " Last Name:" + self .lname + " Blacklisted:" + self .isblacklisted
12
+
13
+ def setIsblacklisted (self ,isblacklisted ):
14
+ self .isblacklisted = isblacklisted
15
+
16
+ def isblacklisted (self ):
17
+ return self .isblacklisted
18
+
19
+ def setTitle (self ,title ):
20
+ self .title = title
21
+
22
+ def getTitle (self ):
23
+ return self .title
24
+
25
+ def setFname (self ,fname ):
26
+ self .fname = fname
27
+
28
+ def getFname (self ):
29
+ return self .fname
30
+
31
+ def setLname (self ,lname ):
32
+ self .lname = lname
33
+
34
+ def getLname (self ):
35
+ return self .lname
36
+
37
+
38
+
39
+ # customer1 = Customer()
40
+ # customer1.setTitle("Mr.")
41
+ # customer1.setFname("Barack")
42
+ # customer1.setLname("Obama")
43
+ #
44
+ # customer2 = Customer()
45
+ # customer2.setTitle("Mrs.")
46
+ # customer2.setFname("George")
47
+ # customer2.setLname("Bush")
48
+ #
49
+ # print("First Customer Title %s" , customer1.getTitle())
50
+ # print("Second Customer Title %s" , customer2.getTitle())
51
+ # print("First Customer Title %s" , customer1.getTitle())
52
+
You can’t perform that action at this time.
0 commit comments