Lecture Notes
PYTHON DATA TYPES
➢ Python has rich set of data types, including:
➢ Numeric data types:
These data types are used to store numbers. They include
integers, floats, and complex numbers.
➢ String data types:
These data types are used to store text.
➢ Sequence data types:
These data types are used to store ordered collection of
data. They include lists, tuples, and ranges. ➢ Mapping data types:
These data types are used to store key-value pairs.
They include dictionaries.
➢ Boolean data types:
These data types are used to store logical values. They
can be either true o false.
➢ Set data types:
These data types are used to store unordered collections
of unique data.
➢ NoneType:
This data types is used to represent the absence of a
value. Data Type:
Example:
Integer
10,-10,0
Complex
10+2j,-10-2j
Float
10.5,-10.5,0.0
String
“Hello, world”!,’This is a
string’
List
[1,2,3],[“a”, “b”, “c”]
Tuple
[1,2,3],(“a”, “b”, “c”)
Range
Range(10), range(1,10)
Dictionary
{“name”:Tressa
Zulauf”,”age”:21}
Boolean
True,False
NoneType
None