Use the offline Python IDLE to program below (download from Python if you have not installed):
list_literals.py
Write a program that creates a Python list containing exactly 5 integers. Print the list to check its values.
two_d_list.py
Create a 2-D list with 2 rows and 3 columns of strings (e.g., names of fruits). Print the 2-D list to confirm the structure.
access_update.py
Create a list of scores [12, 18, 9, 21, 15]. Then:
list_methods.py
Start with data = [4, 5].
Append one new number.
Extend the list with two more numbers.
Insert a number at index 1.
Print the final list after each operation.
trace_output.py
Copy this list into your program: names = ["Ava", "Ben", "Chen", "Dia"].
Add print statements to show what happens when:
"Chen" with "Chan".fix_error.py
The following code contains an error. Run it, explain the error in comments, then correct it:
items = [2, 3, 5]
items[3] = 7
two_d_indexing.py
Use the following 2D list:
grid = [
[2, 4, 6],
[1, 3, 5]
]
3.6 to 0.why_lists.py
Write a short program that stores five test scores in a list.
In a comment at the end, explain why using a list is better than using five separate variables.
Start with nums = [10, 20, 30, 40, 50].
Write a program that slices the list to return [20, 30, 40]. Print the result.
Submit all the .py files here: