Day Five LESSON : Data Types in Python
A data type tells Python what kind of value a variable stores. Different data types are used for different purposes.
Example:
x = 5
print(type(x))
Explanation:
- x = 5 stores the number 5 in the variable x.
- type(x) checks the data type of x.
- Since 5 is a whole number, its data type is int (integer).
Output:
<class 'int'>
Understanding data types is important because every Python program works with different kinds of data. The more you practice using data types, the easier it becomes to build powerful programs. Keep learning and growing your coding skills! 🐍💻
Top comments (0)