class student(object):def student(self):self.name=input("enter name:")self.stno=int(input("enter stno:"))self.score=int(input("enter score:"))def dis(self):print("name:",self.name,"stno:",self.stno,"score:",self.score)def stno(self):return self.stnodef name(self):return self.namedef score(self):return self.scorey=[]
j=0
while(j<3):a=student()a.student()y.append(a)j+=1for st in y:st.dis()for b in y:max_v=b.scoreif max_v<b.score:max_v=b.score
print(max,b.stno,b.score)
I write above code, but I think there is a problem with finding maximum number amongst numbers as I am trying this code and I cannot find any solution for that. Do you have any opinion to improve this part of code. Many Thanks