Numeric and Boolean Types
Explore int, float, and bool data types with practical examples.
Introduction
Python has several numeric types. int holds whole numbers, float holds decimals, and complex holds complex numbers like 3+2j.
Integer Type
int stores whole numbers of arbitrary size: x = 42. No overflow — Python integers grow as needed.
x = 42
print(type(x))All lessons in this course
- Variables and Assignment
- Numeric and Boolean Types
- Strings and Type Conversion
- Reading User Input