Skip to content
Advertisement

Read input as nested list in python

I am new to python. I want to read the input from stdin as nested list.

Stdin:

JavaScript

My list should be as follows:

JavaScript

Is there any way I can read the input using list comprehension without needing any extra space.

Advertisement

Answer

This is one way.

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