Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sequential and Random access of elements

Similar presentations


Presentation on theme: "Sequential and Random access of elements"— Presentation transcript:

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 []


Download ppt "Sequential and Random access of elements"

Similar presentations


Ads by Google