Menu

Building the Main Menu

Building the Main Menu

def main_menu():
    create_tables()

    while True:
        print(menu)
        choice = input("Enter your choice (1-10): ").strip()

        if choice == "1":
            add_student()
        elif choice == "2":
            view_students()
        ...
        elif choice == "10":
            print("\nThank you for using the Student Management System. Goodbye!")
            break

main_menu() is what ties the entire project together. It calls create_tables() once at the start, so the database is ready before anything else runs.

The while True loop keeps showing the menu repeatedly, and based on the number the user types, the matching if-elif condition calls the correct function. This continues endlessly until the user selects option 10, which breaks the loop and ends the program.


Student Management System using Python (Beginner-Friendly Project Guide)

AP

Abhishek Pati





Get in Touch For Details