Function call in if statement

also shouldn’t we break the loop if else statement is fulfilled???