It is better to handle the EOFError(triggered when we hit ctrl + D)
in the interaction() method rather than handling it outside in name
== "main". This is to enhance readability of code. Since a
KeyBoardError or EOFError are associated with each new prompt session(a
new prompt session is defined after each iteration of the while loop),
it makes sense to move the error handling of EOFError to interaction
method.
It is better to handle the EOFError(triggered when we hit ctrl + D) in the interaction() method rather than handling it outside in name == "main". This is to enhance readability of code. Since a KeyBoardError or EOFError are associated with each new prompt session(a new prompt session is defined after each iteration of the while loop), it makes sense to move the error handling of EOFError to interaction method.