0% found this document useful (0 votes)
5 views9 pages

Data Types in Python Grade11

The document provides an overview of data types in Python, explaining that they define the kind of data a variable can store. It highlights the basic data types: int, float, bool, and str, along with examples and usage. Additionally, it mentions the use of the type() function for checking data types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views9 pages

Data Types in Python Grade11

The document provides an overview of data types in Python, explaining that they define the kind of data a variable can store. It highlights the basic data types: int, float, bool, and str, along with examples and usage. Additionally, it mentions the use of the type() function for checking data types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

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.

You might also like