https://faxue.inmoke.com

Python Online Test

A university's Office of Admission keeps track of student majors. Each student can have a single major. Below is an example of how their system stores students and majors, and how it manipulates them:

students = [("Allen Anderson", "Computer Science"), ("Edgar Einstein", "Engineering"), ("Farrah Finn", "Fine Arts")] def add_new_student(students, name, major): students.append((name, major)) def update_student(students, index, name, major): students[index] = (name, major) def find_students_by_name(students, name): return [student for student in students if name in student[0]] def get_all_majors(students): return [student[1] for student in students]

What can be concluded from the code snippet above?

郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。