I Wrote This Code to Take in 5 Grades Take the Average and Display a Message Based on the Average, It Is Acting Up

I keep getting this error message for my python program: ValueError: max() arg is an empty sequence

This means that the list grades is empty, as you have not appended any values into the list. You can fix it by doing:

grades = []

for student in students:
grade = eval(input(f"Enter the grade for {student}: "))

Note that this change is at the top part of the code.

Average calculation

Assuming your data is stored in the database, see SAP's help on AVG

How to compute the sum and average of elements in an array?

var sum = 0;
for( var i = 0; i < elmt.length; i++ ){
sum += parseInt( elmt[i], 10 ); //don't forget to add the base

var avg = sum/elmt.length;

document.write( "The sum of all the elements is: " + sum + " The average is: " + avg );

Just iterate through the array, since your values are strings, they have to be converted to an integer first. And average is just the sum of values divided by the number of values.

JavaScript average while loop

Try this..