lsession.txt

yotam@durini:yotam:148> python
Python 2.3.5 (#2, May  4 2005, 08:51:39) 
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> mylist = ["first", "2nd", "Shlishi", 4, 777]
>>> len(mylist)
5
>>> mylist[0]
'first'
>>> mylist[1]
'2nd'
>>> mylist[2]
'Shlishi'
>>> mylist[3]
4
>>> mylist[4]
777
>>> mylist[5]
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
IndexError: list index out of range
>>> mylist[1:4]
['2nd', 'Shlishi', 4]
>>> mylist[:2]
['first', '2nd']
>>> mylist[3:]
[4, 777]
>>> mylist + [1.234, 12.34, 123.4]
['first', '2nd', 'Shlishi', 4, 777, 1.234, 12.34, 123.40000000000001]
>>> erase_me = 2
>>> mylist[erase_me]
'Shlishi'
>>> mylist[:erase_me] + mylist[erase_me + 1:]
['first', '2nd', 4, 777]
>>> 
yotam@durini:yotam:149> 

Generated by GNU enscript 1.6.4.