Editorial Staff - - Python Programming

In this post, we are going to share a **Python Program to find sum of even index term**. If you are a python beginner and want to start learning the python programming, then keep your close attention in this tutorial as I am going to share a Python Program to find sum of even index term with the output.

To increase your Python knowledge, practice all Python programs, here is a **collection of 100+ Python problems with solutions.**

Copy the below python program and execute it with the help of **python compiler**.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | /** * Python Program to find sum of even index term */ import math # Return the sum of even index term def evenSum(n) : # Creates a list containing n+1 lists, # each of n+1 items, all set to 0 C = [[0 for x in range(n + 1)] for y in range(n + 1)] # Calculate value of Binomial Coefficient # in bottom up manner for i in range(0, n + 1): for j in range(0, min(i, n + 1)): # Base Cases if j == 0 or j == i: C[i][j] = 1 # Calculate value using previously # stored values else: C[i][j] = C[i - 1][j - 1] + C[i - 1][j] sum = 0; for i in range(0, n + 1): if n % 2 == 0: sum = sum + C[n][i] return sum print evenSum(4) |

Editorial Staff at FreeWebMentor is a team of professional developers leads by **Prem Tiwari** View all posts by Editorial Staff

We use cookies to ensure that we give you the best experience and deliver relevant ads based on your interest, by using our website, you acknowledge that you have read our privacy policy.OkPrivacy policy