Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago