x is a boy studying in 5th class, one day he wondered that shall I learn the sum of natural number till 100. he asked his father, his father said "no no, there is no need to learn it. let me tell you a formula to find the sum of number till n, you can also find nth triangular number with it.". after it Max's father told him the secreat formula. next day Max Went to Kelly(One of his classmate) and started showoffing his skills. can you make a efficient program for helping kelly. be proud of yourself if you didn't used for loop.
Triangular numbers :- shorturl.at/hPSVX
def solution(n):
return (n*(n+1))/2
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(10, 55)
test.assert_equals(799, 319600)