Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Learning Objectives
Students will be able to:
Content:
______________________________________________________________
1
2. Create an empty tuple with the built-in tuple() function in
Python
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
2
3. What is the syntax in creating a tuple?
______________________________________________________________
NOTE: Analyze, examine, and rewrite the code below to create a tuple program
that can access items in tuple using indexing method.
______________________________________________________________
FYI: if item does not exist in the tuple, it will return ValueError Exception
3
3. What does the tuple program do?
______________________________________________________________
______________________________________________________________
d. Select the target item (4th element from the last) of the
tuple by the negative index.
______________________________________________________________
NOTE: Examine and analyze the tuple code program below that can access items
in tuple using count method.
4
b. Tuple Methods Count
______________________________________________________________
NOTE: Examine and analyze the tuple code program below that can access items
in tuple using count method.
______________________________________________________________
5
b. How will you define count method in your own words?
___________________________________________________________
___________________________________________________________
a. Tuple Operation-Slicing
NOTE: Examine and analyze the tuple code program below that can access items
in tuple using slicing tuple operation.
______________________________________________________________
6
b. What does the slice tuple operation do?
______________________________________________________________
c. How does it affect the output?
______________________________________________________________
NOTE: The tuple program below can access items in tuple by reassigning the items
added items under a changing operation. Examine and analyze it.
______________________________________________________________
7
b. What does the reassigning trough adding item to tuple
operation do?
______________________________________________________________
c. How does it affect the output?
______________________________________________________________
NOTE: The tuple code program below can access items in tuple using repetition
trough counting the number of times an item appears under changing operation.
Examine and analyze it.
______________________________________________________________
8
b. What does the repetition trough count method tuple operation
do?
______________________________________________________________
c. How does it affect the output?
______________________________________________________________
NOTE: The tuple code program below can access items in tuple using iteration
changing operation. Examine and analyze it.
______________________________________________________________
9
b. What does the iteration using remove function in tuple
operation do?
______________________________________________________________
c. How does it affect the output?
______________________________________________________________
NOTE: The tuple code program below can access items in tuple using check “item”
if it exists changing operation. Examine and analyze it
______________________________________________________________
10
c. How does it affect the output?
______________________________________________________________
NOTE: The tuple code program below can access items in tuple using find the
length changing operation. Examine and analyze it.
______________________________________________________________
11
c. How does it affect the output?
______________________________________________________________
Application Question:
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
12