Я тщательно рассмотрел проблемы, которые могут быть похожи на мои, к сожалению, ни одна из них не помогла мне решить мою.Я был бы очень признателен, если бы кто-нибудь мог помочь мне в этом: вот мой код:
class Student:
def readData(self):
self.name=input("student name: ")
self.stuno=int(input("student number: "))
self.score=float(input("student score: "))
def getStuno(self):
return self.stuno
def getScore(self):
return self.score
def display(self):
print("-" * 65)
print("student name", " " * 10, "student number", " "
* 10, "student score")
print("-" * 65)
print(self.name, " " * 25, self.stuno, " " * 22, self.score)
# end of class student
# Function Menu()
def menu():
print()
print("1. enter a student: ")
print("2. report completed list: ")
print("3. exit ")
choice= int(input("enter your select from 1 to 3: "))
return choice
# end of menu fucntion
# Report Function
def report():
i=0
while i< len(st):
st[i].display()
i+=1
# end of report
# start main program
st=[]
st1=Student()
while True:
b=menu()
if b==1:
st1.readData()
st.append(st1)
print(st)
elif b==2:
report()
else:
break