Coder Perfect

Should I use “camel case” or underscores in Python? [duplicate]

Problem

So, which is the superior option, and why?

def my_function():

or

def myFunction():

Asked by tdc

Solution #1

I recommend reading PEP8 for everything relevant to Python’s style guide.

To respond to your query:

Answered by aayoubi

Solution #2

For readability, PEP 8 recommends the first form. It can be found here.

Answered by David M

Solution #3

Click here to see if it’s already been answered.

Answered by Harish Kurup

Post is based on https://stackoverflow.com/questions/8908760/should-i-use-camel-case-or-underscores-in-python