Changes

Jump to: navigation, search

OPS435 Python Lab 4

274 bytes added, 09:46, 14 June 2017
PART 1 - Tuples
</source>Let's now see how a tuple differs from a list. We will now create a list and note the difference between them.<br><br>
:#Issue the following to create a list:<source>
list2 = [ 'uli101', 'ops235', 'ops335', 'ops435', 'ops535', 'ops635' ]
</source>
:#See if you can change the value of your list by issuing the following:<source>
list2[0]= 'ica100'
print(list2)
</source>.You should have been successful in changing the value of your list.<br><br>
:#Try changing a tuple value.<source>
t2[1] = 10
</source>sourc
:#Did it work? Once created the tuple values will not be able to change. If you would like a tuple with different values than the tuple you currently have, you must create a new one.<source>
t3 = t2[2:3]
13,420
edits

Navigation menu