Why doesn't this conditional work?

Can someone tell me why this doesn’t work?

def in_range(num, lower, upper):
  if (num >= lower) and (num >= upper):
    return True
    return False

I know, based on the solution, that the else statement isn’t really necessary but shouldn’t it work anyway?

Take another look at the two conditions which must be true for ‘if’ to trigger. I don’t think that’s quite what you mean.

1 Like