Skip to content

Commit 1d06726

Browse files
Add files via upload
1 parent c7ff4f7 commit 1d06726

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

class.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class subject (object):
2+
def __init__(self,name ,branch,year):
3+
self.name = name
4+
self.branch = branch
5+
self.year = year
6+
print("a student object is created ")
7+
def print_details (self):
8+
print("name:",self.name)
9+
print("branch:",self.branch)
10+
print("year:",self.year)
11+
a = subject('rahul' , 'cse' , '2004' )
12+
a.print_details()

class2.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class myclass :
2+
x = 5
3+
p1 = myclass()
4+
print(p1.x)

roughclass.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
a = input("enter string:")
2+
b = input("enter string:")
3+
count = 0
4+
for i in range(0,len(a)) :
5+
if b == a[i] :
6+
print("found")
7+
count = count+1
8+
print(count)

0 commit comments

Comments
 (0)