class student:def __init__(self,name,sub,mark): self.name=name self.sub=sub self.mark=markdef on_kv_board(self): if (self.mark>=450): return True else:`enter code here` return Falsestudents=[]num_student=int(input("Enter the number of students appeared:"))for entries in range(0,num_student):name=input("Student name:")sub=input("Subject in which "+name+" got the highest mark:")mark=int(input("Total marks obtained/500:"))if student(name,sub,mark).on_kv_board() is True: a=(student(name,sub,mark)) students.append(a)print(students)每当我用两个输入来打印students []列表时,它就会给我一个输出[0x03784790的Student.student对象,0x037D61B0的Student.student对象]
1 回答
- 1 回答
- 0 关注
- 152 浏览
添加回答
举报
0/150
提交
取消