Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

IN PYTHON This function will take a string which has two single-digit integers i

ID: 3677232 • Letter: I

Question

IN PYTHON

This function will take a string which has two single-digit integers in it. The first integer found is the starting point. The second integer is the substring length. The output from this function is a return of a substring of the string parameter with numbers removed, which begins at the starting point and returns a string the length indicated by the substring length integer.
Output must be presented in the format identical to that in the check function at the bottom of the template.
If an empty string is passed in, the following string will be returned in identical format to the one shown:
"Empty string"
If the integers passed in as starting and length values are invalid when applied to the string (after the numbers have been removed from it, the following string will be returned in identical format to the one shown:
“Invalid indices"

SAMPLE RUNS
strPtr('')
will return this string in the following format:
"Empty string"


strPtr('a39abcdefghiljklmnopa')
will return this string in the following format:
'cdefghilj'

Explanation / Answer

#!/usr/bin/python # length.py s1 = "Eagle" s2 = "Eagle " s3 = "Eagle " print len(s1) print len(s2) print len(s3)