# define a list of grades
classGrades = [55, 67, 72, 78, 83, 85, 81, 44, 90, 97, 93, 96, 100]
# make sure all grades are sorted so we can calculate median effectively
classGrades.sort()
# define length of list so we can divide it and find median
g = len(classGrades)
if g % 2 == 0:
# to find median when length of classGrades is even you find the two middle values and average them
median = (classGrades[g // 2 - 1] + classGrades[g // 2]) / 2
else:
# to find median value when the length is odd you just find the middle value
median = classGrades[g // 2]
print("Median:", median)