Skip to content
Advertisement

Possible combination of a list to key value pairs keeping 1 element as key and rest as a value

Hi can someone help me with the below requirement ? Please note the list length can be any number , for example i have just put 4.

I need the output as list of dictionaries with 1 value as key and rest of the values clubbed as list of all possible combination.

Thanks in advance.

Input:

JavaScript

Output:

JavaScript

Advertisement

Answer

Try:

JavaScript

Prints:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement