# This program plays with strings and their behaviors. def main(): print "Hello! \n This program plays with strings and their behaviors." string=raw_input("Please, input any sentence and press Enter:") #print "What would you like to print "counting the number of occurences of letter 'a' in it:", print string.count('a') print "Let's calculate the length of the sentense:", print len(string) print "Let's make all letters upper case:" print string.upper() print string print "Let's compose a new string:" position= string.find(' ') str2=string[:position] pos2=string.find(' ',position+1) str3=string[position+1:pos2] print str2 + " ho-ho-ho " + str3 print "and finally let\'s generate 3 copies of our original string:" print string * 3 main()