

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Variables
incomplete
2: Variables Vary
incomplete
3: Math
incomplete
4: Negative Numbers
incomplete
5: Comments
incomplete
6: Variable Names
incomplete
7: Basic Variable Types
incomplete
8: F-Strings in Python
incomplete
9: NoneType Variables
incomplete
10: NoneType Quiz
incomplete
11: Dynamic Typing
incomplete
12: Math With Strings
incomplete
13: Multi-Variable Declaration
incomplete
14: Boots
incomplete
15: Spellbook
incomplete
16: Character Report
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Variable names must not have spaces. They're continuous strings of characters.
The creator of the Python language himself, Guido van Rossum, implores us to use snake_case for variable names. What is snake case? It's just a style for writing variable names. Here are some examples of different casing styles:
| Name | Description | Code | Language(s) that recommend it |
|---|---|---|---|
| Snake Case | All words are lowercase and separated by underscores | num_new_users |
Python, Ruby, Rust |
| Camel Case | Capitalize the first letter of each word except the first one | numNewUsers |
JavaScript, Java |
| Pascal Case | Capitalize the first letter of each word | NumNewUsers |
C#, C++ |
| No Casing | All lowercase with no separation | numnewusers |
...just don't do this |
To be clear, your Python code will still work with Camel Case or Pascal Case, but can we please just have nice things? We just want some consistency in our craft.
If you won't use snake case for you, do it for me. I beg you.