Home »
Python »
Python List MCQs
Suppose I have a list L2= [45,56,22,11,34,1,3] and I want to update the value of index 4 to 1000. How will I do that?
20. Suppose I have a list L2= [45,56,22,11,34,1,3] and I want to update the value of index 4 to 1000. How will I do that?
- L2= [4] =1000
- L2[3] =1000
- L2[4] =1000
- L2[(4)]=1000
Answer: C) L2[4] =1000
Explanation:
To update the value we will use the following syntax: - L2[4] =1000.