The instructions are extremely terse. The 'Sum of consequtive numbers' is strange to explain - you could perhaps mention this is a mathematical progression, or mention triangle numbers. When I first attempted the problem I thought 'n' was a list not a number! Mention the types you expect too.
Removing the case of negative numbers would be very good too - they are a bit of a nasty concept here. Leave them in only if you have to.
I would suggest this phrasing:
'sum_of_n' takes an integer 'n' and returns a list of length abs(n) + 1. The list contains the first numbers in the arithmatic series produced by taking the sum of the consequtive integer numbers from 0 to n inclusive.
This comment is hidden because it contains spoiler information about the solution
The instructions are extremely terse. The 'Sum of consequtive numbers' is strange to explain - you could perhaps mention this is a mathematical progression, or mention triangle numbers. When I first attempted the problem I thought 'n' was a list not a number! Mention the types you expect too.
Removing the case of negative numbers would be very good too - they are a bit of a nasty concept here. Leave them in only if you have to.
I would suggest this phrasing:
'sum_of_n' takes an integer 'n' and returns a list of length abs(n) + 1. The list contains the first numbers in the arithmatic series produced by taking the sum of the consequtive integer numbers from 0 to n inclusive.
Should use Test.assert_equals() for the unit tests.
The example unit test uses 'expect' instead of 'assert_equal'
The example uses 'lambda' instead of 'def' for defining f and g.
Using === instead of assertSimilar() makes this much harder to debug. Please use assertSimilar!