Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> hand = dealHand(5)
- >>> hand
- {'a': 1, 'x': 1, 'l': 1, 'd': 1, 'p': 1}
- >>> handClone = hand.copy()
- >>> handAlias = hand
- >>> handAlias
- {'a': 1, 'x': 1, 'l': 1, 'd': 1, 'p': 1}
- >>> handAlias is hand
- True
- >>> handClone is hand
- False
- >>> hand == handAlias == handClone
- True
- >>> hand
- {'a': 1, 'x': 1, 'l': 1, 'd': 1, 'p': 1}
- >>> handAlias.clear()
- >>> hand == handAlias == handClone
- False
- >>> hand
- {}
- >>> handAlias
- {}
- >>> handClone
- {'a': 1, 'x': 1, 'l': 1, 'p': 1, 'd': 1}
Advertisement
Add Comment
Please, Sign In to add comment