Problem 1: Skip Add (100pts)
Write a recursive function skip_add
that takes a single argument n and returns n + n-2 + n-4 + n-6 + ... + 0
. Assume n is non-negative.
this_file = __file__
def skip_add(n):
""" Takes a number n and returns n + n-2 + n-4 + n-6 + ... + 0.
>>> skip_add(5) # 5 + 3 + 1 + 0
9
>>> skip_add(10) # 10 + 8 + 6 + 4 + 2 + 0
30
>>> # Do not use while/for loops!
>>> from construct_check import check
>>> # ban iteration
>>> check(this_file, 'skip_add',
... ['While', 'For'])
True
"""
"*** YOUR CODE HERE ***"