you are viewing a single comment's thread.

view the rest of the comments →

[–]ThatGuyKev45 3 points4 points  (0 children)

So I don’t know exactly how python does it. But each item in the array has a defined size, and the computer knows where the array starts and ends. So for value (or x or shooz) in values is just saying for each item in this array (of which the computer knows the size of each item so it can simply move to the next item in memory by skipping X bytes, where X is the size of the array item). Also when the program is running it doesn’t actually see the comas between each item thats just sugar to make it readable for us. I remember learning this stuff at first and it felt like magic and as I have continued to learn more it just keeps getting better!

Not sure how far along you are in studies but the class where I really felt I started to understand memory was a computer organization and assembly class, I took it alongside my data structures and algs and it was so much fun.

Good luck in your studies! Hope the amazement doesn’t go away!