{"id":20014,"date":"2021-09-06T13:33:01","date_gmt":"2021-09-06T08:03:01","guid":{"rendered":"https:\/\/python-programs.com\/?p=20014"},"modified":"2021-11-22T18:36:29","modified_gmt":"2021-11-22T13:06:29","slug":"python-program-to-find-sum-of-tuple-items","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-sum-of-tuple-items\/","title":{"rendered":"Python Program to find Sum of Tuple Items"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Find the Sum of Series 1+X+X^2\/2…+X^N\/N<\/a><\/p>\n

Given a tuple and the task is to find the sum of the given tuple elements.<\/p>\n

Tuple in Python:<\/strong><\/p>\n

A tuple is an immutable list of objects. That means the elements of a tuple cannot be modified or changed while the program is running.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Tuple = (12, 1, 45, 20, 10, 15, 35)<\/pre>\n

Output:<\/strong><\/p>\n

The Sum of the given tuple elements (12, 1, 45, 20, 10, 15, 35) = 138<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Tuple = (30, 23, 65, 13, 45, 67, 89)<\/pre>\n

Output:<\/strong><\/p>\n

The Sum of the given tuple elements (30, 23, 65, 13, 45, 67, 89) = 332<\/pre>\n

Program To Find Sum of Tuple Items in Python<\/h2>\n

Below are the ways to find the sum of given tuple elements:<\/p>\n