Python Data Types - Class 11 Notes
In Python, data types define the type of values a variable can store. Class 11 Computer Science
introduces the following basic data types.
1. Numeric Types
int → Integer numbers (e.g., x = 10)
float → Decimal numbers (e.g., y = 3.14)
complex → Numbers with real and imaginary part (e.g., z = 2 + 3j)
2. Sequence Types
str → String of characters (e.g., name = 'Ganesh')
list → Ordered, mutable collection (e.g., fruits = ['apple', 'banana', 'mango'])
tuple → Ordered, immutable collection (e.g., coordinates = (10, 20, 30))
3. Mapping Type
dict → Key–value pairs (e.g., student = {'name':'Ganesh','age':16,'class':'11th'})
4. Set Types
set → Unordered collection of unique items (e.g., colors = {'red','green','blue'})
frozenset → Immutable set (e.g., vowels = frozenset({'a','e','i','o','u'}))
5. Boolean Type
bool → True or False (e.g., is_student = True)
6. Special Type
NoneType → Represents nothing/empty (e.g., x = None)
Summary Table
Category Data Types
Numeric int, float, complex
Sequence str, list, tuple
Mapping dict
Set set, frozenset
Boolean bool
Special NoneType