Pep8

代码示例

3
0

pep8功能

# Pep 8 Style Guide for function definition. Function names are snake case
def function_name():
2
0

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',
    )
2
0

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
1
0

python代码风格

This python pep sums it up: https://www.python.org/dev/peps/pep-0008/
0
0

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',
)

类似页面

带有示例的类似页面

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................