Question: How to create a new list with a specific format from an existing list? Write a code for the following example: >>> greetings_old = ['5,9,BYE',

How to create a new list with a specific format from an existing list?

Write a code for the following example:

>>> greetings_old = ['5,9,BYE', '7,5,HI'] >>> greetings_new(greetings_old) [[7, [5], []], [5, [], [9]]]

So the input formate is ['str, str, str' , 'str, str, str']

So the output format should be: [[number, [number of HI], [number of BYE]]

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!