Home›Learn›Python›Python Data Types
PYTHON MASTER COURSEBEGINNER FRIENDLY

Python Data Types

Learn Python Data Types with simple explanations, practical examples, interview questions, MCQs and hands-on practice.

📖 Chapter 4 / 22⏱️ 8–10 Min Read🎯 Beginner Friendly
Course Progress18%
📘

Theory

Understand the concept step by step

Python Data Types

A data type tells Python what kind of value is being stored.

Common Data Types

  • int — whole numbers
  • float — decimal numbers
  • str — text
  • bool — True or False
  • list — ordered mutable collection
  • tuple — ordered immutable collection
  • set — unordered collection of unique values
  • dict — key-value collection
  • None — absence of a value

Checking a Type

Use the type() function.

print(type(10))
print(type(3.14))
print(type("Python"))

Python automatically determines the type from the value assigned.

💻

Example

Try this Python code yourself

Python
age = 21
height = 5.2
name = "Aradhya"
is_student = True

print(type(age))
print(type(height))
print(type(name))
print(type(is_student))
📤

Output

Expected result of the program

Output
<class 'int'>
<class 'float'>
<class 'str'>
<class 'bool'>
📝

Practice

Test your understanding

💡

Try it yourself

Don't just read the example. Open your Python editor and write the program yourself. Try changing the values and observe what happens.

PRACTICE 01

Modify the example program and experiment with different values.

PRACTICE 02

Write the same program from scratch without looking at the example.

❓

Quick Quiz

Test what you learned

Question 1 of 5Score: 0

What is Python?

💼

Interview Questions

Prepare for your Python interview

1

Interview Question

What are the main features of Python?

+

Answer

Python is easy to learn, dynamically typed, interpreted, object-oriented and has a large ecosystem of libraries and frameworks.

2

Interview Question

Why is Python popular among developers?

+

Answer

Python has simple syntax, extensive libraries, strong community support and is widely used in web development, automation, data science, machine learning and artificial intelligence.

3

Interview Question

Is Python compiled or interpreted?

+

Answer

Python is generally described as an interpreted language. Python source code is converted into bytecode and then executed by the Python Virtual Machine.

Chapter 4 of 22

Keep going — you're doing great! 🚀

18%