Python BATCH 11 Voice
Python BATCH 11 Voice
PROGRAMMING
- PROBLEM SOLVING USING
FUNCTIONS IN PYTHON
BATCH - 11
• 231FA04467
• 231FA04453
• 231FA04443
• 231FA04421
Display results:
Print the results of each operation along with appropriate labels and information.
SOURCE CODE:
students = [
{"name": "Alice", "marks": [[90, 85, 88, 92, 91], [85, 80, 82, 90, 88]]},
{"name": "Bob", "marks": [[88, 90, 87, 85, 84], [82, 85, 90, 88, 86]]},
{"name": "Charlie", "marks": [[80, 82, 85, 88, 90], [75, 80, 78, 82, 80]]}
]
def find_first_rank_students(students):
first_rank_students = []
max_total_marks = max(sum(student["marks"][0]) for student in students)
for student in students:
if sum(student["marks"][0]) == max_total_marks:
first_rank_students.append(student["name"])
return first_rank_students
max_total_marks: first_rank_students.append(student["name"])
return first_rank_students
def find_students_with_same_marks_in_all_subjects(students):
all_repeats_students = []
for student in students:
if len(set(student["marks"][0])) == 1:
all_repeats_students.append(student["name"])
return all_repeats_students
course_index = 0
print("Students who secured the first rank:", find_first_rank_students(students))
print("Students who repeat all the subjects:",
find_students_with_same_marks_in_all_subjects(students))
print("Students who repeat in course", course_index + 1, ":",
find_students_with_same_marks_in_course(students, course_index))
print("Students who got the highest score in course", course_index + 1, ":",
find_students_with_highest_score(students, course_index))
print("Students who got the lowest score in course", course_index + 1, ":",
find_students_with_lowest_score(students, course_index))
average_score, std_deviation = calculate_average_and_std_deviation(students,
course_index)
print("Average score in course", course_index + 1, ":", average_score)
print("Standard deviation in course", course_index + 1, ":", std_deviation)
print("Absentees in course", course_index + 1, ":", find_absentees(students,
course_index))
OUTPUT:
THANK YOU