i didn't understand looping in python, so I dug a little deeper
If you’ve ever wondered why this code doesn’t change a list:
arr = [1, 2, 3]
for x in arr:
x = 10
but this one does:
for i in range(len(arr)):
arr[i] = 10
then you’ve bumped into three core Python concepts that are often explained badly:
I...
samyakdev.hashnode.dev4 min read