0
def change(Is): Is[1] = 8 Ist = [5,6] change(Ist) print(sum(Ist))
Can anyone describe to me? How it's working?
5 Antworten
+ 4
When we are calling the function with the lst as input. It does:
Change the 2nd element of the input to 8
So now the second element of the lst becomes: 8
And hence the list changes to: [5,8]
And the last line is just to show the sum of all the elements in the lst:
Hence, 5+8 = 13
+ 4
Use correct relevant tag .you mentioned cpp but you posted question in Python language 😱🤔
+ 2
I guess your concepts are not clear!
ls is the input provided to the function!
It can be any value, but in this case it is lst
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2286/
0
How it's changed to 8?
"Is and Ist" are related to?
0
Sorry!