I did it like this, to me it seems easier to read
def caught_speeding(speed, is_birthday): value = 0 if is_birthday: speed -= 5 if speed >= 81: value = 2 elif speed >= 61: value = 1 return value