The document outlines the main built-in data types in Python including numeric types like integers and floats, Boolean, sequences like strings, lists and tuples, and dictionaries. Numeric types represent numbers, Boolean represents true/false values, sequences are ordered collections of data, and dictionaries store data in key-value pairs. The examples provided illustrate how each data type is represented in Python code.
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 ratings0% found this document useful (0 votes)
67 views
2-Data Types in Python
The document outlines the main built-in data types in Python including numeric types like integers and floats, Boolean, sequences like strings, lists and tuples, and dictionaries. Numeric types represent numbers, Boolean represents true/false values, sequences are ordered collections of data, and dictionaries store data in key-value pairs. The examples provided illustrate how each data type is represented in Python code.
Complex A number with a real and imaginary component is represented
number as a + bj inPython where a and b are floats and
j = √-1
Examples: 4+6j, -2.3+6.4j
Note: The common mathematical representation of a complex number uses a +bi with i being the imaginary part. But in electronics j is used because i already represent current and the next letter after i is j.
Boolean Any representation of data which has two values denoted by
True and False.
Sequence An ordered collection of similar or different data types. The
built-in Sequence data types in Python are – String, List and Tuple.
String A collection of one or more characters put in single, double or