67 248
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #3372 in Python for mukunda

Question #3372
Write Program to print sum of n even numbers in recursive method
Expert's answer
def sum_even_numbers (n):
if n == 0: return 0
return 2 * n + sum_even_numbers(n-1)

print(sum_even_numbers(7))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions