Skip to content

Instantly share code, notes, and snippets.

@brianspiering
Last active October 2, 2021 13:06
Show Gist options
  • Save brianspiering/5d3fb41ced2a664a7186fe9f0d4db757 to your computer and use it in GitHub Desktop.
Save brianspiering/5d3fb41ced2a664a7186fe9f0d4db757 to your computer and use it in GitHub Desktop.
Explore variable naming in Python prompts

Find out if each of the following is either an acceptable or not acceptable Python identifier.

Do this by trying to assign them as an identifier for a variable. If you get a SyntaxError: can't assign to operator, fix the error by changing the identifier.

- sumTotal 
- sumtotal
- sum-total 
- sum total
- sum_total
- sum
- 2x
- -4
- $16
- U$O
- 10%
- if
- while 
- Private 
- public
- _static 
- _4
- _
- ___ 
- maçã_da_beira_alta
- ಠ_ಠ
- λ
- 🐶
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment