''' This code use for print string fixed length ''' data="Life is very easy with Python" print data[0:4] ''' print from where first "Py" found ''' print data[data.find("Py"):] ''' print last six character ''' print data[-6:] print data[len(data)-6:len(data)] ''' from last six characters ignore last two characters ''' print data[-6:-2]