print(10) # 10
print(4 + 3 + 2 + 1) # 10
print(type(10)) # <class 'int'>
10
10
<class 'int'>
🔢 Let’s start with the building blocks! In this section, you’ll explore Python’s basic Data Types. Understanding these is key to writing code that behaves the way you expect. Think of it as learning the alphabet before writing full sentences.
int
)Whole numbers, positive or negative.
float
)Decimal numbers, positive or negative.
bool
)Represents True
or False
values, often used in conditionals.
str
)Sequences of Unicode characters.
None
)Represents the absence of a value.
Some frequent errors encountered when dealing with Data Types in Python.
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[11], line 1 ----> 1 print(Tyler) NameError: name 'Tyler' is not defined
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[12], line 1 ----> 1 print(int(Tyler)) NameError: name 'Tyler' is not defined