From 62db71045495dc5f1428c8cd5ac9239fc10f2efa Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 15:33:15 +0000 Subject: [PATCH] style: format code with Autopep8, Black, isort, Ruff Formatter and Yapf This commit fixes the style issues introduced in 3070e4c according to the output from Autopep8, Black, isort, Ruff Formatter and Yapf. Details: None --- student_database.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/student_database.py b/student_database.py index b9bcc5b..1d7ef76 100644 --- a/student_database.py +++ b/student_database.py @@ -1,16 +1,19 @@ import os + students = [] + def add_student(): num_students = int(input("Enter the number of students: ")) - + for i in range(num_students): student = {} student["name"] = input("Enter the name of the student: ") student["age"] = input("Enter the age of the student: ") student["gender"] = input("Enter the gender of the student: ") students.append(student) - + + def remove_student(): name = input("Enter the name of the student to remove: ") for student in students: @@ -20,7 +23,8 @@ def remove_student(): break else: print("Student not found") - + + def view_student(): name = input("Enter the name of the student to view: ") for student in students: @@ -31,13 +35,15 @@ def view_student(): break else: print("Student not found") - + + def display_all_students(): for student in students: print(f"Name: {student['name']}") print(f"Age: {student['age']}") print(f"Gender: {student['gender']}") - + + def update_student(): name = input("Enter the name of the student to update: ") for student in students: @@ -45,8 +51,6 @@ def update_student(): student["name"] = input("Enter the name of the student: ") student["age"] = input("Enter the age of the student: ") student["gender"] = input("Enter gender of student") - - def start(): @@ -58,9 +62,9 @@ def start(): print("5. Update Student") print("6. Restart Program") print("7. Exit Program") - + choice = int(input("Enter your choice: ")) - + if choice == 1: add_student() elif choice == 2: @@ -74,4 +78,4 @@ def start(): elif choice == 6: os.system("python3 student_database.py") elif choice == 7: - os.exit() \ No newline at end of file + os.exit()