What is the naming convention in Python for variable and function names?
- by Ray Vega
Coming from a C# background the naming convention for variables and method names are usually either CamelCase or Pascal Case:
// C# example
string thisIsMyVariable = "a"
public void ThisIsMyMethod()
In Python, I have seen the above but I have also seen underscores being used:
# python example
this_is_my_variable = 'a'
def this_is_my_function():
Is there a more preferable, definitive coding style for Python?