Python - Types and Casting
Code Life
By Pierre Marsaa
Introduction to data types
Like you saw earlier, variables can hold different types of data. Here is a really short introduction to the most basic ones.
type casting - source
There are 4 basic types.
- Two are numbers (integer and float)
- One is a boolean (bool)
- The last one is a string (str).
The following examples will be about numbers because we talked about them in the previous chapter.
We will talk about booleans and strings a bit later.
Verify