CHAPTER 07   •   PYTHON

Python Data Types

Learn the main data types available in Python.

01 What is this?

Learn the main data types available in Python.

02 Syntax

Python Syntax
type(value)

03 Example

Python Example
name = 'AIFA'
age = 20
price = 99.50
active = True

print(type(name))
print(type(age))
print(type(price))
print(type(active))

04 Important Points

Common types include str, int, float, bool, list, tuple, set and dict.

05 Common Mistakes

Do not assume every value has the same data type.

06 Real World Use

Data types determine how information can be stored and processed.

07 Practice This Topic

Now try the example yourself in the AIFA Python Editor.

  • Read the example carefully.
  • Change the values.
  • Run the code.
  • Observe the output.
  • Try creating your own example.
Try It Yourself →