Question: 2. (Total 10 marks) Tuples You are going to form a list of coordinate (1, y) tuples for plotting a graph as shown below. 15

 2. (Total 10 marks) Tuples You are going to form a

2. (Total 10 marks) Tuples You are going to form a list of coordinate (1, y) tuples for plotting a graph as shown below. 15 14 13 12 11 10 9 8 7 6 5 3 2 1 0 X 0 5 6 (a) (2 marks) According to the graph, create two lists named 'x' and 'y' which contains the corresponding E-coordinate and y-coordinate of the data points. (b) (3 marks) Using part (a), write a single line of code to create a list of coordinate tuples. Store the list in a variable named 'coordinates'. (c) (1 mark) A student would like to update point (4.10) in the list to (5,10). He therefore wrote the following line of code but resulted in error. Explain why he cannot modify the point this way. You can use "Comment" to write your answer in Jupyter Notebook Template provided. coordinates (2) (e-5 TypeError Traceback (most recent call last) in modules ----> 1 coordinates [2][@]=5 (d) (4 marks) Update the list 'coordinates' to modify the item (4,10) to (a, b), where a and b are the last two digits of your student number. For example, a student with student ID 12345678 should modify the item (4,10) to (7.8). Hint: The list function index() allows you to obtain the index of the item (4,10) in the 'coordinates' list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!