'invalid syntax while reading multiple txt files

Everyone I am facing problem you can see it in pic attached. when i run it on Google Colab it works perfetly and when trying to run it in local it encounter the syntax error. how it will be corrected any one how to solve it, Thanks. enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source