5.8. Summary¶
In this chapter, you learned about a couple of different data types built-in to Python. These data types include the numeric data types: integers, floats, and complex numbers. The string data type is composed of letters, numbers, spaces, and punctuation. Python also has container data types which can store many values. These container data types include lists, tuples, and dictionaries. Strings, lists and tuples can be indexed and sliced using square brackets [ ]
.
5.8.1. Key Terms and Concepts¶
data type
variable
assignment operator
integer
int
whole number
floating point number
float
scientific notation
complex number
string
boolean
bool
boolean arithmetic
boolean operators
or
and
not
data structure
dictionary
tuple
list
index
indexing
immutable
5.8.2. Summary of Python Functions and Commands¶
5.8.2.1. Built-in Data Types¶
Python Data Type |
Description |
---|---|
|
integer |
|
floating point number |
|
boolean value: True or False |
|
complex number, real and imaginary components |
|
string, sequence of letters, numbers and symbols |
|
list, formed with |
|
dictionary, formed with |
|
an immutable list, formed with |
5.8.2.2. Python Functions¶
Function |
Description |
---|---|
|
output a variable or object data type |
|
return the length of a string, list dictionary or tuple |
|
convert a |
|
convert a |
|
convert an |
5.8.2.3. Python List Operators¶
Operator |
Description |
Example |
Result |
---|---|---|---|
|
indexing |
|
|
|
start |
|
|
|
end |
|
|
|
through |
|
|
|
start, step, end+1 |
|
|