Pull request for Lecture 2 assignments for sea-c28

The *args was the best thing I did in the whole assignment I think. It
really simplified that bit.

I agree with you about the parenthesis line continuation. It seems
cluttered in general.

On Wed, Dec 3, 2014 at 12:41 PM, Joshua Frailey <notifications@github.com>
wrote:

> In Students/ConstantineHatzis/series.py:
>
> > +    test_values_lucas = [2, 1, 3, 4, 7, 11, 18, 29]
> > +
> > +    # The 5th value of the Fibonacci and Lucas Numbers, and an unknown
> > +    # function
> > +    test_values_sum_series = ([[5, 0, 1, 3], [5, 2, 1, 7],
> > +                              [5, 4, 3, "That function is not available yet"]])
> > +
> > +    # Test fibonacci() and lucas()
> > +    for n in range(7):
> > +        assert fibonacci(n + 1) == test_values_fibonacci[n]
> > +        assert lucas(n + 1) == test_values_lucas[n]
> > +
> > +    # Test sum_series()
> > +    for n in range(2):
> > +        assert (sum_series(*test_values_sum_series[n][0:3]) ==
> > +                test_values_sum_series[n][3])
>
> This is a really cool use of *args!
>
> Using Python's implied line continuation inside parenthesis is a great
> (and correct) way to wrap long lines. However, I find that assigning
> intermediate symbols makes the code more readable when there are operators
> or comparisons (such as ==) in the long line. Something like this:
>
> for n in range(2):
>     test_output = sum_series(*test_values_sum_series[n][0:3])
>     expected = test_values_sum_series[n][3]
>     assert test_output == expected
>
> This, of course, is purely stylistic preference.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/codefellows/sea-c28-students/pull/42/files#r21263207>.
>