Page 80 - Modular v1.1 Pyhton
P. 80
D. Short answer type questions.
1. Define the term list.
2. While traversing a list when will user get an IndexError?
3. What is indexing?
4. Name the list method which reverses the order of the elements in the list.
5. What do you mean by the term negative indexing?
E. Long answer type questions.
1. Differentiate between indexing, negative indexing and slicing.
2. What is the use of repeating lists?
3. Describe remove( ), index( ), count( ) list methods.
4. Write a program to add element (12, 2, 34, 65) to the list=[13, 25, 41, 63, 82].
5. What is the purpose of using max(list) and min(list) functions?
Critical Thinking
F. What will be the output of the following programs?
1. list=[13, 25, 41, 63, 82] 2. list=[13, 25, 41, 63, 82]
list[1]=50 list.append(19)
list[3]=45 print(list)
print(list[:])
3. list=[13, 25, 41, 63, 82] 4. list=[13, 25, 41, 63, 82]
list.insert(1, 302) list1=[14, 26, 42, 64]
print(list) print(len(list))
print(max(list))
print(min(list))
In the lab Computational Thinking
Write a program to:
1. create a list with the following values: [4, 9, 10, 28]
2. create two nested list with the following values: [4, 9, 10, 28] and [7, 11, 13, 48]
3. traversing a list [4, 9, 10, 28] by using negative indexing.
4. change the elements of a list [4, 9, 10, 28, 87, 98] at index 1 and 4 to 45 and 55 respectively.
Teacher's Corner
1. Discuss about different operations of list with the students.
2. Explain the difference between indexing and negative indexing to the students.
78 Touchpad MODULAR (Version 1.0)

