-
Book Overview & Buying
-
Table Of Contents
Python Illustrated
By :
In this chapter, we introduced variables. We learned that variables are like containers: they have labels and hold values, which help keep our code flexible. We learned about naming variables, how they must start with a letter or underscore, and that variable names are case-sensitive. We discussed best practices, such as using descriptive names and the Python convention of using snake_case for variable names. Of course, we also learned how to assign a value to a variable using the = sign, as in this example:
favorite_toy = "ball"
Next, we looked at how different types of data can be assigned to variables: number values (integers and floats), strings, and floats. However, we know these are just some basic data types, and that Python allows many more types.
We also learned that Python is dynamically typed, meaning it doesn’t care whether you change the type of a variable when you reassign it to a new value.

With these fundamentals in place...