Question: please used in basic python language! thank you Given a list of integers from 1~9, write code to create a series of new lists, such
please used in basic python language! thank you


Given a list of integers from 1~9, write code to create a series of new lists, such that each new list will include one digit from the original list, repeated for a number of times as indicated by the number itself. For example, assuming a list as following: [9, 6, 4, 7, 8, 2, 5] , the output lists will look as the following: Part a) Expected output: 999999999 666666 4444 7777777 88888888 22 55555 Noted that your program should be applicable when the data inside ls changes (but are still in valid range and format). 1 ls [9, 6, 4, 7, 8, 2, 5] 2 3 # Start your code below 4 # Part a Part b) Expected output: [9, 9, 9, 9, 9, 9, 9, 9, 9] [6, 6, 6, 6, 6, 6] [4, 4, 4, 4] [7, 7, 7, 7, 7, 7, 7] [8, 8, 8, 8, 8, 8, 8, 8] [2, 2] [5, 5, 5, 5, 5] 1 # Start your code below 2 # Part b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
