python. operation list | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

python. operation list

What is the result of this code? nums = [1, 2, 3, 4, 5] nums[3] = nums[1] print(nums[3]) why is the answer = 2?

24th Jun 2018, 7:57 PM
Ione Mezok
Ione Mezok - avatar
2 Answers
+ 1
simply because nums[1] = 2 nums[3] was given the value of nums[1] (start counting from 0)
24th Jun 2018, 8:21 PM
davy hermans
davy hermans - avatar
0
i solved it 2 hours ago. sometimes i m so tired.... but you know an programmer never sleep they are like keyboard ....2 shift 😀
25th Jun 2018, 2:33 AM
Ione Mezok
Ione Mezok - avatar