strings we will require loop because we have to repeatedly print sections of the stringand to print the sections of the stringwe will use slicename input'enter your name'for in range(len(name))print(name[: + ]end'the one trick is to use the loop variable in the slice since the number of characters we need to print is changingwe need variable amount in the slice this is reminiscent of the triangle program from section we want to print one character of the name the first time through the looptwo characters the second timeetc the loop variableistarts at the first time through the loopthen increases to the second time through the loopetc thus we use name[: + to print the first + characters of the name finallyto get all the slices to print on the same linewe use the print function' optional argument end='example write program that removes all capitalization and common punctuation from string lower(for in ';:-?!()\'' replace( ''the way this works is for every character in the string of punctuationwe replace every occurrence of it in with the empty string'one technical note herewe need the character in string as described in the previous sectionwe get it into the string by using the escape character \example write program thatgiven string that contains decimal numberprints out the decimal part of the number for instanceif given the program should print out input'enter your decimal number'print( [ index'):]the key here is the index method will find where the decimal point is the decimal part of the number starts there and runs to the end of the stringso we use slice that starts at index('here is anothermore mathematical wayto do thisfrom math import floor num eval(input'enter your decimal number'print(num floor(num)one difference between the two methods is the first produces stringwhereas the second produces number