- 2
What is the result of this code?
nums = [1, 2, 3, 4, 5] nums[3] = nums[1] print(nums[3])
1 Respuesta
+ 4
#This is the simplified one, run this and try to understand.
nums = [1, 2, 3, 4, 5]
print("value of fourth position= ", nums[3])
print("value of second position= ",nums[1])
print("replacing fourth value with second one")
nums[3] = nums[1]
print("now value of fourth position= ", nums[3])