String index out of range: -1 due to length function

Printable View