Question: python Time left 0:26:46 Create a function that read a integer list that contains set of positive and negative numbers of size 'N! The maximum

 python Time left 0:26:46 Create a function that read a integer

python

Time left 0:26:46 Create a function that read a integer list that contains set of positive and negative numbers of size 'N! The maximum length of each element in a set is based on list size "N". For example if the list size is '6' then the maximum length of each element is "6". Example list of elements is (-343, 2324, 345543,-56554,564, 36733]. The list elements must be read as integer not as characters. Must create a user defined function to perform the following operations; The sum between each element in list will be calculated based on the same length of each element that matches with other elements: For the above example in the list the length of each elements is: 1.-343 length is '3, 2324 length is 4, 345543 length is '6: -56554 length is '5, 564 length is '3' and 36733 length is 5 Hence the sum is calculated as follows: 2.-343+564=221 l/Both numbers having same length '3' 3.-56554+36733=-19821 //Both numbers having same length '5' 4. 2324= 4232 (since the length is '4' and it is not matched with any other elements in the list, it should be stored in reversed order) 5. 345543=345543 6. 345543=345 (since the length is '6' and it is not matched with any other elements in the list, it should be stored in reversed order & it is also a palindrome, hence remove the repeated digits in the secondary part of the palindrome(highlighted in BOLD) recursively until no palindrome is presents) 7. In the first round the list is [221, -19821,4232,345) 8. Use steps 1-6 recursively, until the length of the digit is not same in the list. ie. 221 length is '3; -19821 length is '5, 4232 length is '4' and 345 length is '3', since the first and last elements are having same length then sum both: 221+345=566; length is 3 -19821 =-12891 (reversed); length is 5 4232 =2324 (reversed); length is 4 9. The list elements are now [566, -12891, 2324), //refer no elements are in the same length. 10. Then create a function to convert the above elements as positive numbers to negative numbers and vice-versa.i.e After the conversion the list elements are (-566,12891,-2324] & Finally arrange the list elements according to the increasing order of elements length irrespective of sign (+, or -). 11. The final output would be for the above example:(-566, -2324, 12891]

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!