Skip to content

Commit 38529d5

Browse files
authored
Merge pull request #95 from Varun270/master
Added a new .py file for classes in python(OOP)
2 parents f97b3a2 + 779b27f commit 38529d5

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

Contributing.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Contributions are always welcome!!!!
2+
If you want to contribute to this repository follow the below procedure -
3+
1. Fork this repository
4+
2. Clone the code to your local system and go through readme.md
5+
3. You can create another branch to add further commits
6+
7+
GIT COMMANDS FOR CONTRIBUTING -
8+
1. To clone this repository
9+
`git clone [code link]`
10+
2.To create new branch
11+
`git checkout -b [branch name] `
12+
3. To stage files
13+
`git add .`
14+
4.To commit changes
15+
`git commit -m "commit message"`
16+
5. To push changes
17+
`git push [remote branch] [new branch]`
18+
19+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)