def times2(k):
k[?] = k[?] * 2
k[?] = k[?] * 2
a = [1, 2]
b = [3, 4]
times2(a)
times2(b)
print('a = ', a, 'b = ', b)
I wonder what's in the 2nd or 3rd row?
The resulting value should be a = [2, 4] b = [6, 8]
I'd appreciate your help.
https://www.geeksforgeeks.org/python-change-list-item/
Search keyword: python list reassign
© 2024 OneMinuteCode. All rights reserved.