-1
name
, hours
및 qpoints
과 같은 속성을 가진 Student
개체가 포함 된 목록이 있습니다. 목록은 변수 data
에 저장됩니다. 다음에서 None
반품을받는 이유는 무엇입니까? 즉 은 Student
클래스의 gpa를 반환하는 메서드가 있지만 None
을 반환합니다. 내 코드에 Student
클래스를 가져 왔습니다.목록의 목록을 파이썬 객체 목록
def choiceInput(data):
choice = input('Enter method of sorting <GPA>, <Name>, or <Credits>: ')
choice = choice[0].lower()
if choice == 'g':
return data.sort(key = Student.gpa)
elif choice == 'n':
return data.sort(key = Student.getName)
else:
return data.sort(key = Student.getpPoints)
이 위협 요소는 어디에서 찾을 수 있습니까? – lhoernle