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

Naming convention

Why didn't he call "amount_due", "cost_per_person" instead?

1 Answer

Steven Parker
Steven Parker
243,318 Points

You didn't mention the course and video (or provide a link), but this kind of name is probably not covered by a common convention other than the general practice of using names descriptive of the variable's use.

These terms are very similar and probably both would be a good choice for the variable in question. If the value contains a calculated total, "amount_due" might be slightly more descriptive, and if it contains a base cost to be used in a calculation, "cost_per_person" might be better.