Download presentation
Presentation is loading. Please wait.
1
Sequential and Random access of elements
Lists in Python Sequential and Random access of elements
2
Random vs. Sequential Lists have two ways to be accessed
random (direct) sequential Both are useful in their place If you need to access ALL elements of a list (either in order or order doesn’t matter), sequential is the way to go because it is simpler Otherwise you need to access elements randomly
3
Examples sequential for i in range(5): print(myList[i]) random
Note that it is the order of elements accessed that makes it sequential or random, both will use the []
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.