Course Content
Introduction to Python
Introduction to Python
Data Types
In Python, like in many other programming languages, you can work with objects of various types. It's essential to understand the differences among them, especially when considering how they're stored in computer memory. Here are the data types available in Python:
- Text:
str
; - Numeric:
int
,float
,complex
; - Sequence:
list
,tuple
,range
; - Mapping:
dict
; - Set:
set
,frozenset
; - Boolean:
bool
; - Binary:
bytes
,bytearray
,memoryview
.
Note
There's no necessity to memorize all of them at this moment.
We won't dive deep into every one of these data types right now, as we won't be using all of them immediately. Instead, we'll go into detail on each one in upcoming chapters. If you're curious about the type of a specific variable, use the type()
function. And remember, always use the print()
function to have Python display the result. For instance:
# Create some variable var = 12 # Check variable type print(type(var))
Thanks for your feedback!