Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # It might be better to invert the conditional
- # putting the early exit at the top of the
- # function
- # Passes test for f(0), f(1)
- def f(term):
- # assert term >= 0
- if term > 1:
- # This part of the implementation
- # does not return a correct value,
- # BUT preserves the behavior that
- # passed the test.
- return term
- # This part of the implementation
- # returns the correct value
- return term
- end
Add Comment
Please, Sign In to add comment