coding style - where to declare variables

Chris Angelico rosuav at
Sun Jul 22 09:39:02 EDT 2018

On Sun, Jul 22, 2018 at 10:48 PM, Sharan Basappa
<sharan.basappa at> wrote:
> In other programming languages (e.g. C, C++), as a good practice, variables are declared right at the start of the program, irrespective of where it is normally used. What is the practice in Python?
> I see that, most of the code, declare variables where it is used and not at the start of the program.

Common practice in Python is to never declare your variables, since
Python doesn't have variable declarations.


More information about the Python-list mailing list