4 problems: ‘,’ or ‘)’ expected
Statement expected, found Py:COLON
End of statement expected
Statement expected, found Py:RPAR
def my_substr(string, num):
# index = len(string) - 1
return string(1: num)`
error in the 3 line
>Solution :
It looks like you’re trying to slice string. If that’s the case, that syntax uses square brackets ([]), not parentheses (()):
return string[1:num]
# Here ------^-----^