"find", "replace", "capitalize"....
>>> str="DJ is a good boy"
>>> str
'DJ is a good boy'
>>> print str
DJ is a good boy
>>> print str.find('good')
9
>>> print str.replace('good', 'bad')
DJ U r a bad Boy
>>> print(str.capitalize())
Dj u r a good boy
>>> str
'DJ U r a good Boy'
"range"
>>> a=range(6)
>>> a
[0, 1, 2, 3, 4, 5]
>>> for i in a:
... print i
...
0
1
2
3
4
5
>>> range(-10, 2)
[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1]
>>> range(-10, -4)
[-10, -9, -8, -7, -6, -5]
"List"
>>> list=['cat', 'apple', 'banana'] #Creating a list
>>> list #Print the List
['cat', 'apple', 'banana']
>>> list[1] #Print the second element of the list. cat=0, apple=1, banana=2 ...
'apple'
>>> list[1]='america' #Replace the 1st element('cat') with ('america')
>>> list
['cat', 'america', 'banana']
>>> list[1:]=['debojyoti', 'bally', 'howrah'] #Replace the entire list starting from the 2nd element
>>> list
['cat', 'debojyoti', 'bally', 'howrah']
>>> list[:] #Print the entire list
['cat', 'debojyoti', 'bally', 'howrah']
>>> list[:2] #Print the 0 and 1st elements. Same as list[0:2]
['cat', 'debojyoti']
>>> list[:-1] #Same as list[0:-1]. Means print from zero element --> before last element(cat=0, debojyoti=-3, bally=-2, howrah=-1)
['cat', 'debojyoti', 'bally']
>>> list[-1]
'howrah' #Print only the last element
>>> list[-3:-1]
['debojyoti', 'bally']
>>> a = [1, 2, 3, 4, 5]>>> a[2:3] = [0, 0]>>> a[1, 2, 0, 0, 4, 5]>>> a[1:1] = [8, 9]>>> a[1, 8, 9, 2, 0, 0, 4, 5]>>> a[1:-1] = []>>> a[1, 5]
Iterating over list index and value pairs (enumerate)
>>> for i, x in enumerate(a):
... print i,':',x
...
0 : DJ
1 : Banerjee
2 : Bally
3 : Howrah
"Start a static HTTP server in any directory"
[10:26] $ python -m SimpleHTTPServer 5000 Serving HTTP on 0.0.0.0 port 5000 ...