
Untitled
By: a guest on
May 14th, 2012 | syntax:
Python | size: 0.31 KB | hits: 22 | expires: Never
print "Without copying the list"
hand = list(range(16))
player1 = hand
player2 = hand
player1.remove(5)
print hand
print player1
print player2
print "\n*With* copying the list"
hand = list(range(16))
player1 = list(hand)
player2 = list(hand)
player1.remove(5)
print hand
print player1
print player2