Question: Create a python program in that read an integer list that contains set of positive numbers of size N. The maximum length of each element

 Create a python program in that read an integer list that

Create a python program in that read an integer list that contains set of positive numbers of size "N". The maximum length of each element in a list is based on the list size "N". For example if the list size is "6" then the maximum length of each element is "6", Let us consider the array elements are [4365, 633, 262645, 48,7,54910](NOTE:Don't read the list elements in the form of strings/characters). Create a function called "Recursive_Sum" that takes integer list as argument and calculate the recursive sum for the elements present in the list. For the above example, the first element is 4365, its sum is 4+3+6+5=18->1+8=9 (recursive sum: at last the recursive-sum always gets only single digit number it may be any number between 1 and 9), likewise all the elements in the list, the recursive sum will be calculated. Hence, the newly formed list for the above example is 19,3,7,37,1). Again, Calculate Final Sum (recursive sum) using another function named "Final Sum" for the elements currently present in the newly formed list. ie. 9+3+7+3+7+1=30->3+0=3. After finding out the "Final_Sum", in this case it is 3, now check whether the Final Sum (ie. 3) is exist in the each item in the input list. If the Final Sum (ie. 3) is present then replace the element with 1 otherwise 0. Hence our input list now becomes (1,1,0,0,0,0). Well-done, but your job is not yet over, convert this binary number (110000) to equivalent decimal number, ie, here it is 48. Yes, 48 is our final result. ALL THE BEST Input: 6//array size 4365 633 262645 48 7 54910 Output 48

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!