Tuesday, July 14
Shadow

Code HS Tracy Python Exercise 9.5.6: Swapping

list_one = [1, 2, 3]
list_two = [4, 5, 6]

print “Before swap”
print “list_one: ” + str(list_one)
print “list_two: ” + str(list_two)

Loading...

swap_lists(list_one, list_two)

print “After swap”
list_one,list_two=list_two,list_one
print “list_one: ” + str(list_one)
print “list_two: ” + str(list_two)

(Visited 1,671 times, 1 visits today)