0
i don't understand this nums=[7,7,7,7,7] nums[2]=5 print(nums) ans: [7,7,5,7,7] how??
4 Respuestas
+ 2
indexing starts with 0
+ 2
I think because the index of the array starts with 0 so changing nums[2] to 5 will change the 3rd number in the array. I'm still new to coding though.
+ 1
aaam I understand now.. I need replace it
+ 1
first,you assigned nums list and in the second line you told the IDE to add another number '5' in the 3rd sequence of the list. This is a way to add a data to a list.