0% found this document useful (0 votes)
2 views1 page

Python Data Types Notes

The document outlines various data types in Python, including numeric types (int, float, complex), text type (str), boolean type (bool), sequence types (list, tuple, range), set types (set, frozenset), mapping type (dict), and None type (NoneType). It also mentions the use of the type() function to check data types. Each data type is illustrated with examples for clarity.

Uploaded by

nayanrudy580
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Data Types Notes

The document outlines various data types in Python, including numeric types (int, float, complex), text type (str), boolean type (bool), sequence types (list, tuple, range), set types (set, frozenset), mapping type (dict), and None type (NoneType). It also mentions the use of the type() function to check data types. Each data type is illustrated with examples for clarity.

Uploaded by

nayanrudy580
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Data Types in Python

1. Numeric Data Types


• int – Whole numbers (e.g., 10, -5)
• float – Decimal numbers (e.g., 3.14)
• complex – Numbers with real and imaginary parts (e.g., 2+3j)

2. Text Data Type


• str – Used to store text (e.g., "Hello")

3. Boolean Data Type


• bool – True or False

4. Sequence Data Types


• list – Ordered and changeable (e.g., [1,2,3])
• tuple – Ordered but not changeable (e.g., (1,2,3))
• range – Sequence of numbers

5. Set Data Types


• set – Unordered, no duplicates
• frozenset – Unchangeable set

6. Mapping Data Type


• dict – Key-value pairs (e.g., {"name":"Nayan"})

7. None Data Type


• NoneType – Represents no value

Check Data Type


Use type() function

You might also like