Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> a = (1, 2, 3, 4, 5, 6)
- >>> a[3]
- 4
- >>> a[2:]
- (3, 4, 5, 6)
- >>> a[:3]
- (1, 2, 3)
- >>> a[2:3]
- (3,)
- >>> a[2:6]
- (3, 4, 5, 6)
- >>> a[2:6:2]
- (3, 5)
- >>> a[::-1]
- (6, 5, 4, 3, 2, 1)
- >>> d = {(1, 1, 1) : 1}
- >>> d
- {(1, 1, 1): 1}
- >>> a = (5,)
- >>> a
- (5,)
- >>> a = tuple('hello, world!')
- >>> a
- ('h', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd', '!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement