From 4e9dcea0f1b4b07783e2e8eeea6ce4a0ca07e9b3 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 14:22:54 +0000 Subject: [PATCH] style: format code with Autopep8, Black, isort, Ruff Formatter and Yapf This commit fixes the style issues introduced in ffba4e1 according to the output from Autopep8, Black, isort, Ruff Formatter and Yapf. Details: None --- assignment.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/assignment.py b/assignment.py index 16c49a3..2656ec4 100644 --- a/assignment.py +++ b/assignment.py @@ -6,6 +6,7 @@ def add_student(students): students[roll] = (name, age, subject) print("Student added successfully!") + def update_student(students): roll = int(input("Enter roll number of the student to update: ")) if roll in students: @@ -17,6 +18,7 @@ def update_student(students): else: print("Student not found!") + def delete_student(students): roll = int(input("Enter roll number of the student to delete: ")) if roll in students: @@ -25,18 +27,25 @@ def delete_student(students): else: print("Student not found!") + def search_student(students): roll = int(input("Enter roll number of the student to search: ")) if roll in students: print("Student found!") - print(f"Name: {students[roll][0]}, Age: {students[roll][1]}, Subject: {students[roll][2]}") + print( + f"Name: {students[roll][0]}, Age: {students[roll][1]}, Subject: {students[roll][2]}" + ) else: print("Student not found!") + def print_students(students): print("List of students:") for roll in students: - print(f"Roll number: {roll}, Name: {students[roll][0]}, Age: {students[roll][1]}, Subject: {students[roll][2]}") + print( + f"Roll number: {roll}, Name: {students[roll][0]}, Age: {students[roll][1]}, Subject: {students[roll][2]}" + ) + if __name__ == "__main__": students = {} @@ -61,4 +70,4 @@ def print_students(students): elif option == 6: break else: - print("Invalid option!") \ No newline at end of file + print("Invalid option!")