Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

157 bytes added, 07:26, 3 June 2017
PART 1 - Navigating Items in Lists
list2[2:4] # Starting with index 2 and stopping before index 4
list3[3:] # Starting with index 3 and going to the end
</source>:#Lists can also contain other lists. This means lists data can containbe contained in: lists and of strings, lists of integers, or lists contains a combination of strings and integers all together. <br><br>:#Issue of the following to create a list that contains lists:<source>
list4 = [ [1, 2, 3, 4], ['a', 'b', 'c', 'd'], [ 5, 6, 'e', 'f' ] ]
</source>:#This The list still just created only has 3 index locations. Each index points to another the individual liststored as the list element. <source>
list4[0]
list4[1]
13,420
edits