Should I use "camel case" or underscores in python?

tdc picture tdc · Jan 18, 2012 · Viewed 196k times · Source

So which is better and why?

def my_function():

or

def myFunction():

Answer

aayoubi picture aayoubi · Jan 18, 2012

for everything related to Python's style guide: i'd recommend you read PEP8.

To answer your question:

Function names should be lowercase, with words separated by underscores as necessary to improve readability.