Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65bfe39 commit 9281d73Copy full SHA for 9281d73
.gitignore
@@ -0,0 +1 @@
1
+.idea/
objectorientedpython.py
@@ -0,0 +1,21 @@
+# Basic Class Definition
2
+class Monitor():
3
+ def __init__(self, model):
4
+ self.model = model
5
+
6
7
+# Create Instances Of The Class
8
+monitor1 = Monitor("Samsung")
9
+monitor2 = Monitor("Viewsonic")
10
11
+# Print The Class and Property
12
+print(monitor1)
13
+print(monitor1.model)
14
+# <__main__.Monitor object at 0x01702E98>
15
+# Samsung
16
17
18
+print(monitor2)
19
+print(monitor2.model)
20
+# <__main__.Monitor object at 0x01042F28>
21
+# Viewsonic
0 commit comments