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 f97b3a2 commit f7893b6Copy full SHA for f7893b6
Object Oriented Programming/building our first class.py
@@ -0,0 +1,20 @@
1
+#Today we will learn how to create a class and other attributes of class
2
+#Below is the method how classes are defined
3
+class Student:
4
+ pass
5
+
6
+#Below is the method to create object , Here Varun and rohan are two objects of Class Student
7
+Varun = Student()
8
+larry = Student()
9
10
+# Now after creating objects we can use them to call variables
11
+Varun.name = "Harry"
12
+Varun.std = 12
13
+Varun.section = 1
14
+larry.std = 9
15
+larry.subjects = ["hindi", "physics"]
16
+print(Varun.section, larry.subjects)
17
18
19
20
0 commit comments