Question: Write a Python program that reads a number and finds the sum of the series of 1 + 33 + 111 + 3333 +....+N terms.

Write a Python program that reads a number and finds the sum of the series of 1 + 33 + 111 + 3333 +....+N terms. Then it puts the reverse digit of the sum to a list and prints it. [Cannot use built-in reverse() or reversed()]

================================================

Sample Input 1: 5 Sample Output 1: Sum of series: 14589 Reverse sum of series in list: [9, 8, 5, 4, 1] Explanation1: The input is 5 so the series will go on till 5th term. So the series becomes, 1 + 33 + 111 + 3333 + 11111. So the sum of the series is 14589. The reverse of the sum is 98541. So the reverse digits are 9, 8, 5, 4 and 1. Thus putting them into a list, the output becomes [9, 8, 5, 4, 1]

================================================

Sample Input 2: 3 Sample Output 2: Sum of series: 145 Reverse sum of series in list: [5, 4, 1] Explanation2: The input is 3 so the series will go on till 3th term. So the series becomes, 1 + 33 + 111. So the sum of the series is 145. The reverse of the sum is 541. So the reverse digits are 5, 4 and 1. Thus putting them into a list, the output becomes [ 5, 4, 1]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!