diff --git a/main.py b/main.py index de36a74..1cd7fbe 100644 --- a/main.py +++ b/main.py @@ -42,8 +42,9 @@ 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: print('ERROR' + str(e)) - diff --git a/user_IO.py b/user_IO.py index 2f31563..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): @@ -43,6 +45,7 @@ def user_output(subject, categories, average, average_subject): print(string + "\n") print("The average of {} is {}.".format(subject, average_subject)) + def password(): print("What is your password?") - return input() \ No newline at end of file + return input()