Question: Rewrite this recursively in python # sumEven(n): # sumEven(n) return the sum of even numbers from 0 to n. def sum_even(n): total = 0 for
Rewrite this recursively in python
# sumEven(n):
# sumEven(n) return the sum of even numbers from 0 to n.
def sum_even(n):
total = 0
for i in range(2, n+1,2):
total = total + i
return total
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
