Professional Documents
Culture Documents
Notes 04 Exercises
Notes 04 Exercises
• Use append method to populate this list with the following items: 2.3,
“CMP 211”, False, 23, True, 6. Print the list after populating.
• Write a program to generate a sublist of the list [30, 60, 90, 120, 150, 180,
210], the sublist should be made up of the third item up to the fifth item
(inclusive) of the original list. Print the sublist.
Answer
sublist = x[:]
print(sublist)
sublist = x[3:6]
print(sublist)
• Change the fourth value in the list ['NG', 'US', 'IN', 'CH', 'GM', 'CA'] to 'GH'.
• unis = ['AUL', 'UNN', 'NAU', 'UI', 'OAU', 'ABU', 'UNN']. Write a program to
loop through the list and print 'University of Nigeria Nsukka' when it is UNN.