Python variable names

Is there a stylistic rule for calling variables?

For example, variables between different functions with the same destination.

My question is about names in function signatures.

name = 'somevalue1'
path = 'some/value'
process(name, path)

What about the names in the signature? They must be the same.

def process(name, path):
     ...

Or maybe something like this:

def process(_name, _path)
    ...

Or

def process(name1, path1)
    ...
+4
source share
3 answers

Basically, it is left to your liking, but there really is a style guide for Python called PEP8 .

There are even some IDEs (like PyCharm ) that support code testing for PEP8 compliance on the fly.

+1
source

For example, variables between different functions with the same destination.

, , , .

, , , , :

def process(name, path):

( , "" - , , ).

. , "" "" ! (). , .

+1

, , PEP8. , , Google

0

All Articles