Professional Documents
Culture Documents
University
Department of Computer Science and Engineering
Submited by:
Md Abu Ryan
Id: 202-15-14408
Section: A
self.name = name
self.rollno = rollno
self.marks = marks
ob = Student(Name, Rollno,marks)
ls.append(ob)
print("\n")
for i in range(ls.__len__()):
if (ls[i].rollno == rn):
return i
ls = []
obj.accept("Asif", 2,65)
obj.accept("abul", 3,99)
print("\n")
print("\nList of Students\n")
for i in range(ls.__len__()):
obj.display(ls[i])
s = obj.search(3)
obj.display(ls[s])
b)
In the programme above,we need to use exception handling in the searching part.Because we have a
limited data set and there is limited data stored.If a user tries to access a data through index which
actually doesn’t belong to our dataset or beyond our dataset it will show an error message to the
user.To fix this we should use exception handling in that part so that we can handle this through our
code.
c)
import numpy as np
lst=[]*3
for i in range(0,3):
ls1=[]
for j in range(0,3):
x=int(input())
ls1.append(x)
lst.append(ls1)
print(lst)array=np.array(lst)
matrix=array.reshape(3,3)
trans=matrix.transpose()
print(trans)