python variable naming conventions code example
Example 1: python naming conventions
import mymodule
my_variable = 'value'
CONSTANT = 'never changes'
class MyClass(self):
pass
Example 2: camelcase naming convention python
class ExampleClass(self):
pass
Example 3: pep 8 function
def function_name():
Example 4: python code style
This python pep sums it up: https://www.python.org/dev/peps/pep-0008/
Example 5: pep8
my_list = [
1, 2, 3,
4, 5, 6,
]
result = some_function_that_takes_arguments(
'a', 'b', 'c',
'd', 'e', 'f',
)
Example 6: python naming script
def get_name():
print("Hello what is your name?")
name = input("My name is: ")
print("Hello ", name)
return name