Question: Question 6 3 pts There has probably been too much math in this recitation already, so let us instead switch to working with character strings.

Question 6 3 pts There has probably been too much math in this recitation already, so let us instead switch to working with character strings. The Python library has a rich library of useful functions already, so it is rather contrived to come up with a simple problem that does not already have a function already defined for it. But here's one Complete a function that looks at the back end of a string, and figures out how many times the last character is duplicated. For example, "Testing... ends with four periods. Recall that negative subscripts count backwards from the end of the string. def tail_len (string): "Counts the repetitions of the last character in the given string" index while index index-1 # back up return This should give the correct answer of 4 when applied to "Testing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
