r/pythontips • • Oct 17 '21

Syntax Python Beginner Mistakes

As a Python trainer, I get to work with pynewbies across the spectrum. It doesn't matter whether they are from college or years into the industry when learning Python. The simplest language on the earth is not that intuitive. Things get even more challenging when they are well versed in a Typed-Object-Oriented-Language

I have compiled some of the common mistakes that beginners make.

https://thelearning.dev/python-beginner-mistakes

52 Upvotes

12 comments sorted by

View all comments

1

u/bazzam13 Oct 18 '21

Using Package names as file names

Whenever I introduce flask to my students, I name the file app.py, and there will be one person in the class who calls it flask.py that will give you an error like Flask not found in module flask.

The error occurs because the Python interpreter searches for the Flask class in the flask.py you created instead of the actual flask package.

Never name your module the same as the package you are trying to use.

100% did this the first time I tried to make a Flask app.