Chapter 2
Why do we need to use variables in code?
Variables work as aliases or symbols in mathematic equations. With variables, we can write business logic, or how, without knowing specific values, or what, beforehand – we don't have to repeat doing so over and over again.
What is the recommended way of naming variables? Why does it matter?
There are a few simple requirements when it comes to naming variables that are mandatory—they can't start with a number, contain whitespaces, or special characters. Finally, none of the keywords that are reserved by Python can be used.
That being said, there is some guidance on to better naming; first of all – PEP8. According to PEP, it is recommended to name variables meaningfully and consistently so ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access