cannot use import statement outside a module
The error ‘cannot use import statement outside a module’ is self-explanatory, which means it is the error that occurs when you attempt to use an import statement outside of a module such as in the global scope of a script or inside a function. In Python The above error occurs in Python usually when your …