1 year ago

#212984

test-img

teuscast

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

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’])

nested-lists

read-text

0 Answers

Your Answer

Accepted video resources