Two Pointer Algorithm Python Template Literal