Professional Documents
Culture Documents
Marks Stu
Marks Stu
Marks Stu
def max_marks(present_stu):
max=present_stu[0]
for i in present_stu:
if i>max:
max=i
print("The maximum marks are: ",max)
return max
max_marks(present_stu)
def min_marks(present_stu):
min=present_stu[0]
for i in present_stu:
if i<min:
min=i
print("The minimum marks are: ",min )
return min
min_marks(present_stu)
def highest_frequency():
current_max=0
max_value=None
for i in present_stu:
if present_stu.count(i)>current_max:
current_max=present_stu.count(i)
max_value=i
print("The most frequent element is: ", max_value)
print("Number of occurences are: ", current_max)
highest_frequency()
Output:
Enter the total number of students:5
Enter the marks of student: 20
Enter the marks of student: 30
Enter the marks of student: -1
Enter the marks of student: 20
Enter the marks of student: 50
The maximum marks are: 50
The minimum marks are: 20
The most frequent element is: 20
Number of occurences are: 2
The average marks are: 24.0
Present students are: 4
Absent students are: 1