Reading from a .txt file and creating a nested list - Python

234 Views Asked by At

I have a txt. file that I need to read and create a nested list. However some of details needs to be removed from the nested list. Please see the example below:

file1.txt

One Type

1

2

3

4

Friend

Sky

House

After Run the code I have to get:

(’type’, [1,2,3,4], \ [’Friend’, \ ’Sky’,\ ’House’])

0

There are 0 best solutions below