Data Types in Python
Class 11 – Computer Science
Presented by: Your Name
Introduction to Data Types
• • Data types tell the type of data a variable
can store.
• • In Python, everything is an object with a
type.
Basic Data Types
• 1. int – Integer numbers (e.g., 5, -10, 100)
• 2. float – Decimal numbers (e.g., 3.14, -2.5)
• 3. bool – Boolean values (True, False)
• 4. str – String of characters (e.g., "Hello", 'A')
Numeric Data Types
• • int: Whole numbers
• • float: Numbers with decimal point
• • complex: Numbers with real and imaginary
parts (e.g., 3 + 4j)
String Type (str)
• • A sequence of characters inside quotes
• • Examples:
• name = "Meenakshi"
• grade = '11'
Boolean Type (bool)
• • Has only two values: True and False
• • Used in comparisons and conditions
• • Example:
• 5 > 3 → True
• 2 == 4 → False
Data Type Examples
• x = 10 # int
• y = 3.14 # float
• z = "Python" # str
• a = True # bool
Type Checking
• Use type() function to check the data type:
• print(type(x)) # <class 'int'>
Summary
• • Python has different data types for different
kinds of data.
• • Common types: int, float, str, bool
• • Use type() to find the data type.