Log in
← All problems

Sum from 1 to n

easyBasics10 XP

Return 1 + 2 + … + n. For n of 0 the answer is 0.

Examples

Examples use JSON: true/false/null are True/False/None in Python.

Run examples checks the examples above. Submit also runs 3 hidden tests.