diff --git a/main.py b/main.py index d4b1b2e..3514075 100644 --- a/main.py +++ b/main.py @@ -30,6 +30,8 @@ try: _subject = user_input[1] subject_get = subject.get_subject(subjects, _subject) user_IO.user_output(subject_get.return_average_subject) + elif input_or_output == "exit": + break raise SystemError except Exception as e: diff --git a/user_IO.py b/user_IO.py index 7ba55ba..bc1ea2e 100644 --- a/user_IO.py +++ b/user_IO.py @@ -1,5 +1,5 @@ def user_input(): - todo = input("Ok, do you want to see them or to edit them [see/edit]?\n") + todo = input("Ok, do you want to see them or to edit them [see/edit/exit]?\n") if todo == "see": print("Which subject do you want to know the information?") subject = input() @@ -31,6 +31,8 @@ def user_input(): grade = input("Grade? \n") grade_name = input("What's the name of the grade? \n") return "input", "grade", subject, category, grade, grade_name + elif todo == "exit": + return "exit" def user_output(subject, categories, average, average_subject):