Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Meet Python Variables

Podrig Leoghain
Podrig Leoghain
5,094 Points

camelCase vs snake_case

You can use either so, even though PEP8 guidelines states using snake_case, use whatever you're comfortable with. If you're planning on learning other languages (which you should do if you are going to be more than a hobbyist (which is fine!)) then just use camelCase.

Thoughts on this?

2 Answers

Even though most languages use camel case, you should stick with using snake case in Python. Most Python libraries use snake case, and most developers use snake case, so your best bet is to follow their conventions!

Read this post

Podrig Leoghain
Podrig Leoghain
5,094 Points

Does it not bother you that an underscore is an extra, unwieldy to type, symbol? I mean, I could remap a key I suppose...

It feels a little extraneous at first, but eventually it feels natural.