Question: Create a Python program to manage student information using functions, tuples, and lists. The program should allow the user to perform the following tasks: Add

Create a Python program to manage student information using functions, tuples, and lists. The program should allow the user to perform the following tasks:
Add a new student along with their grade.
Remove a student from the list.
Update a student's grade.
View the list of students along with their grades.
Calculate and display the average grade of all students.
Guidelines:
Use a list to store the student information. Each element in the list should be a tuple containing the student's name and their grade.
Define functions for each task mentioned above.
Use a loop to continuously prompt the user for actions until they choose to exit.
Use the attached skeleton code, you will fill in the functions. You will upload the completed code as your submission
Attached Code:
def add_student(student_info, name, grade):
# Add a new student to the list
def remove_student(student_info, name):
# Remove a student from the list
return
def update_grade(student_info, name, new_grade):
# Update a student's grade
return
def view_students(student_info):
# View the list of students along with their grades
def calculate_average_grade(student_info):
# Calculate and display the average grade of all students
print(f"Average Grade: {average_grade:.2f}")
def main():
student_info =[] # List to store student information
while True:
print("
Options:")
print("1. Add a new student")
print("2. Remove a student")
print("3. Update a student's grade")
print("4. View list of students")
print("5. Calculate average grade")
print("6. Exit")
choice = input("Enter your choice: ")
if choice =='1':
name = input("Enter student name: ")
grade = float(input("Enter student grade: "))
add_student(student_info, name, grade)
elif choice =='2':
name = input("Enter student name to remove: ")
remove_student(student_info, name)
elif choice =='3':
name = input("Enter student name to update grade: ")
new_grade = float(input("Enter new grade: "))
update_grade(student_info, name, new_grade)
elif choice =='4':
view_students(student_info)
elif choice =='5':
calculate_average_grade(student_info)
elif choice =='6':
print("Exiting program.")
break
else:
print("Invalid choice. Please try again.")
if __name__=="__main__":
main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!