Tuples in python
Tuples in python
a presentation by :
Anna Marie Balcaso and Eullaine Caballero
WHAT IS TUPLE?
WHAT IS TUPLE?
OUTPUT
CHECK IF ITEM EXISTS
CHECK IF ITEM EXISTS
OUTPUT
TUPLE LENGTH
TUPLE LENGTH
OUTPUT
REMOVING A TUPLE
REMOVING A TUPLE
1. count() Method
2. index() Method
TUPLE METHODS
1. count() Method
Return the number of times the value
appears in the tuple Count()
method
returns
total no
times
‘banana’
present in
the given
tuple
TUPLE METHODS
2. index() Method
index()
Method
LIST TUPLE
List can be edited once it A tuple is a list which one
is created in python. Lists cannot edit once it is
are mutable data created in Python code. The
structure. tuple is an immutable data
structure
TUPLE DICTIONARY
Order is maintained. Ordering is not guaranteed.
They can hold any type, Every entry has a key and a
and types can be mixed. value
DIFFERENCE BETWEEN TUPLE AND DICTIONARY
TUPLE DICTIONARY
Elements are accessed Elements are accessed using
via numeric (zero based) key's values
indices