Calculate Average Grade with Course List in Python
This Snippet is coded by a user inOnline python Compiler. You can see and run this code too.
زبان: python
This code is a simple and complete program to calculate a student's GPA (average grade). It defines a list of courses and uses a for loop to prompt the user for each course's grade. The grades are stored in a list, then the average is calculated by summing the grades and dividing by the number of courses, and finally displayed with a message.
Features:
- Use of a list to store course names
- Input grades as floating-point numbers
- Summing grades and computing the average
- Displaying the GPA with a message