Question: slicing words(Python) Write a function called wordPrinter() that accepts a word, a start index, and an end index, word Printer() should print the slice of

slicing words(Python)

slicing words(Python) Write a function called wordPrinter() that accepts a word, a

Write a function called wordPrinter() that accepts a word, a start index, and an end index, word Printer() should print the slice of the word between the start and the end index values and all slices smaller than this, always ending with the full slice. So if I were to call: wordprinter('incredible', 2, 9) you would get the output: le ble ible dible edible redible credible word Printer('disingenuous', 8, 10) ou uou wordprinter('academic', 0, 7) ic mic emic demic ademic cademic academic If the start index is too small or the end index is too large, then you should tell the user of the error and not print any slices of the word. Optional - for those who finished early - Write a version of the function which has a default value for the "end" of the slice, meaning that it will automatically go from the start index to the end of the word. In the case above of the word "academic", you would only need to call wordprinter('academic', 0) to get the same output, as the function would be able to determine from the lack of a third parameter that the end of the word was intended

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!