Answer:
Following are the program in the Python Programming Language.
# Define the function
def Sum(tu):
# Check if the tuple contain 0
if len(tu)==0:
#Then, Return 0
return 0
#Otherwise
else:
#call the recursive function
return tu[0]+Sum(tu[1:])
#Set tuple type variable
tu=(2,5,1,8,10)
#print and call the function
print("The sum of tuple is:",Sum(tu))
Output:
The sum of tuple is: 26
Explanation:
Here, we define a function "sum()" and pass an argument "tu" which stores the tuple type value, inside the function.
Finally, set the tuple type variable "tu" and initialize the value in it then, print and call the function sum.