Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.
Hard to tell with the lack of indentation here, but I suspect it is the indentation itself. Are both lines 18 and 19 indented inside of your with context manager? If line 19 is not indented, then when the context manager finishes reading the contents of quesfile, it will close both files.
Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.
Looks like a typo. You used answerS where you should have used answer inside the compreshension
Thank you!
I like “compreShension” 🙂
Hard to tell with the lack of indentation here, but I suspect it is the indentation itself. Are both lines 18 and 19 indented inside of your with context manager? If line 19 is not indented, then when the context manager finishes reading the contents of quesfile, it will close both files.
Yeah, sorry for that, I fixed indentation but now instead of printing out the questions written in the question files it prints out “easy.txt”?