Professional Documents
Culture Documents
Lesson 2.6 - Data Types
Lesson 2.6 - Data Types
Converting
Data Types
At the end of the discussion,
we would be able to…
List [ ] Mutable
Tuple ( ) Immutable
Set { } Mutable
String Immutable
“ “
List – is an ordered sequence of items. It is one of the
most used data types in Python and very flexible. All items
in a list do not need to be of the same type.
Example:
The colon (: )
inside the index
refers to the
range in the
given data set
Tuple – is an ordered sequence of items, same as a list.
The only difference is that a tuple is immutable. A tuple
once created, cannot be modified.
Example:
Set – is an unordered collection of unique items. It is
defined by values separated by comma inside braces {}.
The items in a set are not ordered.
Example:
Example:
Hello world!
0 1 2 3 4 5 6 7 8 9 10 11
Converting different
Data Types
FIRST,
IDENTIFY THE
DATA TYPE
type() function
Converting!
Error:
THE
END