pep8功能
# Pep 8 Style Guide for function definition. Function names are snake case
def function_name():
pep8
# pep8 Style Guide for Lists
my_list = [
1, 2, 3,
4, 5, 6,
]
result = some_function_that_takes_arguments(
'a', 'b', 'c',
'd', 'e', 'f',
)
camelcase命名约定python
# CamelCase is the way you are meant to name classes:
class ExampleClass(self):
pass
# Start each word with a capital
# Don't seperate words with underscores
python代码风格
This python pep sums it up: https://www.python.org/dev/peps/pep-0008/
pep8
# pep8 Style Guide for Lists (easier to see indentation imo)
my_list = [
1, 2, 3,
4, 5, 6,
]
result = some_function_that_takes_arguments(
'a', 'b', 'c',
'd', 'e', 'f',
)