有人可以帮我这个程序吗?

   class student:

def __init__(self,name,sub,mark):

    self.name=name

    self.sub=sub

    self.mark=mark

def on_kv_board(self):

    if (self.mark>=450):

        return True

    else:`enter code here`

        return False

students=[]

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对象]


慕的地6264312
浏览 153回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Go