# DSL - Assignment 2 students=[] marks=[] total_students_in=int(input("Total number of students are: \t")) # Entering marks def total_students_fn(): for i in range(total_students_in): marks_in=int(input("Enter marks for DSA subject for each student (out of 50) (enter -1 for absent students): \t")) marks.append(marks_in) print("Marks of", total_students_in, "students in DSA subject are:", marks) total_students_fn() # Option 1 = Average def average_marks(): for i in marks: if i<0: break else: average_calc=sum(marks)/total_students_in print("Average score of", total_students_in, "is: \t", average_calc) # Option 2 = Highest and lowest def high_low(): mini=marks[0] maxi=marks[0] for i in range (len(marks)): if (maxi-1): maxi=marks[i] for j in range (len(marks)): if (mini>marks[j] and marks[j]>-1): mini=marks[j] print("Highest marks are: \t", maxi) print("Lowest marks are: \t", mini) # Option 3 = Absent def absent(): absent_count=0 for i in marks: if i==-1: absent_count+=1 print("Total number of absent students out of", total_students_in, "are: \t", absent_count) # Option 4 = Highest freq def high_freq(): freq_count=0 for i in range(len(marks)): if (i>=0): count=0 for j in range(len(marks)): if (marks[i]==marks[j]): count+=1 if (freq_count