Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win32
- Type "copyright", "credits" or "license()" for more information.
- >>> l=[1,4,6,9,4,6,2,3,0,1]
- >>> len(l)
- 10
- >>> l.append(7)
- >>> l
- [1, 4, 6, 9, 4, 6, 2, 3, 0, 1, 7]
- >>> l.sort()
- >>> l
- [0, 1, 1, 2, 3, 4, 4, 6, 6, 7, 9]
- >>> l.reverse()
- >>> l
- [9, 7, 6, 6, 4, 4, 3, 2, 1, 1, 0]
- >>> l.pop()
- 0
- >>> l.pop(6)
- 3
- >>> l
- [9, 7, 6, 6, 4, 4, 2, 1, 1]
- >>> l.append(3)
- >>> l
- [9, 7, 6, 6, 4, 4, 2, 1, 1, 3]
- >>> l.index(6,4)
- Traceback (most recent call last):
- File "<pyshell#13>", line 1, in <module>
- l.index(6,4)
- ValueError: 6 is not in list
- >>> l.index(1,4)
- 7
- >>> set(l)
- {1, 2, 3, 4, 6, 7, 9}
- >>> l
- [9, 7, 6, 6, 4, 4, 2, 1, 1, 3]
- >>>
Add Comment
Please, Sign In to add comment