T
T
tekleworm2018-04-11 15:15:36
Python
tekleworm, 2018-04-11 15:15:36

Remove unnecessary list items?

Hello everyone, I have this list.

<class 'str'>
<class 'str'>
<class 'str'>
<class 'str'>
<class 'str'>
<class 'str'>
<class 'str'>
<class 'str'>
<class 'str'>
<class 'str'>
<class 'str'>

It is necessary to remove some elements that are not needed. I try to do so
for i in list:
    if 'string' in i:
        list.remove(i)

but it does not work, tell me something)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question