Mini Project: Grade Calculator
Build a small program that calculates total, average and performance.
Learn by experimenting
Study the Python code, run it, change values and observe the output. Practical experimentation is an important part of learning programming.
Python Code
Python runs directly in your browser.
marks = [80, 72, 65, 90, 75]
total = sum(marks)
average = total / len(marks)
print('Total:', total)
print('Average:', round(average, 2))
if average >= 70:
print('Performance: Excellent')
elif average >= 50:
print('Performance: Good')
else:
print('Performance: Needs Improvement')
Python Output
Program output appears here.
Test your understanding
Choose the best answer.
Which function can calculate the length of a Python list?