Python TutorialLesson 8Free preview
Python Data Types
This lesson is part of Python · All levels
Summary
Each object in Python has a data type that determines the type of value and operation that can be done. The most basic types include int, float, str, bool, and list, each used for integers, decimal numbers, text, truth, and data sets. The data type can be checked with the type() function so we know how to treat a value.
Key points
- Type int for the integers, float for the decimal numbers, str for the text.
- The bool type has only two values, namely True and False.
- The type() function displays the data type of an object.
- Python is dynamic so that the variable type can change with its latest value.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.