+ 1
Fill in the blank issue
Fill in the blanks to create a list, reassign its 2nd element and print the whole list. nums = [33, 42, 56_ nums[_] = 22 print(____) Ans: nums = [33, 42, 56] nums[1] = 22 print(nums) So my doubt is why nums[1] is 1?
1 Odpowiedź
+ 2
The question says, "reassign its 2nd element". That's what the second line does. In Python the index is counted from 0, so the second element is nums[1].