DEV Community

Cover image for Python Day Five : python learning
Amina
Amina

Posted on

Python Day Five : python learning

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))
Enter fullscreen mode Exit fullscreen mode

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'>
Enter fullscreen mode Exit fullscreen mode

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)