Two Pointer Algorithm Python If Statements And