def sort_by_start_date(courses):
 courses = sorted(courses, key=(lambda course: (course.has_ended(), (course.start is None), course.start)), reverse=False)
 return courses

def sort_by_start_date ( courses ) : courses = sorted ( courses , key = ( lambda course : ( course . has_ended ( ) , ( course . start is None ) , course . start ) ) , reverse = False ) return courses
returns a list of courses sorted by their start date .