In: Computer Science
Write in Python
Let us suppose the name of the list is "grades"
grades= [9,7,7,10,3,9,6,6,2]
a). grades.count(7)
b). grades[len(grades)-1]=4
c). max(grades)
d). grades.sort() # For ascending order
grades.sort(reverse=True) # For descending order
e). sum(grades) / len(grades)
Sample Output:
NOTE : The original output varies for questions d and e when you execute c,d and e separately without executing b.
Because, in b the original list is manipulated.