python variable naming convention 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: pep8
my_list = [
1, 2, 3,
4, 5, 6,
]
result = some_function_that_takes_arguments(
'a', 'b', 'c',
'd', 'e', 'f',
)
Example 4: pep8
my_list = [
1, 2, 3,
4, 5, 6,
]
result = some_function_that_takes_arguments(
'a', 'b', 'c',
'd', 'e', 'f',
)
Example 5: python naming script
def get_name():
print("Hello what is your name?")
name = input("My name is: ")
print("Hello ", name)
return name