Example #1
0
def run_example():
    school = School.create_school_with_students("Hogwart")
    new_school = School.create_school_with_students("New School")

    print("school.MAX_STUDENTS_NUMBER:", school.MAX_STUDENTS_NUMBER)
    print("new_school.MAX_STUDENTS_NUMBER:", new_school.MAX_STUDENTS_NUMBER)

    print()
    print("Po modyfikacji na poziomie obiektu")
    school.MAX_STUDENTS_NUMBER = 125
    print("school.MAX_STUDENTS_NUMBER:", school.MAX_STUDENTS_NUMBER)
    print("new_school.MAX_STUDENTS_NUMBER:", new_school.MAX_STUDENTS_NUMBER)

    print()
    print("school self:")
    school.self_print_max_student_number()
    print("school cls:")
    school.cls_print_max_student_number()

    print()
    print("Po modyfikacji na poziomie klasy")
    School.MAX_STUDENTS_NUMBER = 330
    print("school.MAX_STUDENTS_NUMBER:", school.MAX_STUDENTS_NUMBER)
    print("new_school.MAX_STUDENTS_NUMBER:", new_school.MAX_STUDENTS_NUMBER)
    print("school self:")
    school.self_print_max_student_number()
    print("school cls:")
    school.cls_print_max_student_number()
    another_school = School.create_school_with_students("Other")
    print("another_school.MAX_STUDENTS_NUMBER:",
          another_school.MAX_STUDENTS_NUMBER)
Example #2
0
def run_example():
    school = School.create_school_with_students("Hogwart")
    harry = Student(first_name="Harry", last_name="Potter")
    school.assign_student(harry)
    print(school)

    new_school = school.create_school_with_students("New School")

    print(school.MAX_STUDENTS_NUMBER)
    print(new_school.MAX_STUDENTS_NUMBER)
Example #3
0
def run_example():
    school = School.create_school_with_students("Hogwart")
    students = school.students
    for student in students:
        print(student)
    print("-" * 20)

    students.sort(key=lambda student: student.grades_avg())

    for student in students:
        print(student)
Example #4
0
def run_example():
    school = School.create_school_with_students("Hogwart")
    students = school.students
    for student in students:
        print(student)
    print("-" * 20)

    students.sort()
    # students.sort(key=grades_avg_for_student)

    for student in students:
        print(student)
Example #5
0
def run_example():
    school = School.create_school_with_students("Hogwart")
    students = school.students

    for student in students:
        # student.add_final_grade(1)
        student.add_final_grade(
            1, check_promotion_policy=GradeCalculator.strict_promotion_policy)

    students.sort(key=grades_avg_for_student, reverse=True)
    for student in students:
        print(student)
Example #6
0
def run_example():
    school = School.create_school_with_students("Moja szkoła")
    students = school.students
    for student in students:
        print(student)
    print("-" * 20)

    # for student in students:
    #     student.add_final_grade(1, check_promotion_policy=GradeCalculator.normal_promotion_policy)
    # for student in students:
    #     print(student)
    # print("-" * 20)
    #
    students.sort(key=lambda student: student.grades_avg(), reverse=True)
    for student in students:
        print(student)
Example #7
0
def run_example():
    school = School.create_school_with_students("Hogwart")
    print(school)
Example #8
0
def run_example():
    school = School.create_school_with_students("Hogwart")
    print(school)

    print(f"W szkole może być maksymalnie {school.MAX_STUDENTS_NUMBER} uczniów")