os.path.join (folder, filename) ensures the path is correct for the system. On Windows, it uses backslashes (reports\summary.txt); on Linux and macOS it uses forward slashes (reports/summary.txt).
Windows has a lot of features you probably didn't know about, and this simple command is one of them. But it's still worth using.
A Python visualizer is a tool that shows you how your code runs, step by step, using pictures and diagrams. It helps you see ...