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.stno
def name(self):
return self.name
def score(self):
return self.score
y=[]
j=0
while(j<3):
a=student()
a.student()
y.append(a)
j+=1
for st in y:
st.dis()
for b in y:
max_v=b.score
if 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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…