Users Pricing

forum

Home Forums What is the naming convention in Python for variable and function? – MindStick

What is the naming convention in Python for variable and function?

Erick Wilsom 1349 27 Oct 2022

Coming from a C# background the naming convention for variables and method names are usually either camelCase or PascalCase.

// C# example

string isVariable= "a"
public void IsFunction()

In Python, I have seen the above but I have also seen underscores being used:

# python example

is_variable = 'a'
def is_function():

Is there a more preferable, definitive coding style for Python?


2 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md