I have this problem.
As you can see, I’m trying to catch some exceptions. Everthing is working fine except the ‘EOFError’ (img 1). What I want to do is allow the user to quit the game anytime he wants.
It worked as I expected in another while loop (img 2). The only difference I can see is that the ‘answer’ has a type of string, and ‘game’ has a type of int. But in the middle of the process where I’m expecting the user to give me the answer, if he decide to quit, Ctrl+D works fine. But it works just there.
The problem begins when I ask the user which game he wants to play, but Ctrl+D doesn’t work there. So I’m getting this error message:
During handling of the above exception, another exception occurred:
TypeError: ‘str’ object is not callable
Do you guys have any idea about what I’m missing here?
P.S: I removed the 0 from exit() on purpose. Just trying to figure out what is going on.