'NoneType' is not iterable error with for loop [duplicate]

102
October 05, 2018, at 11:30 PM

This question already has an answer here:

  • TypeError: 'NoneType' object is not iterable in Python 7 answers
  • Why does append return none in this code? 3 answers

I've gone through many questions about the 'NoneType' error, but I can't figure out why this basic for loop gives me a:

TypeError: argument of type 'NoneType' is not iterable.

lst = [1,0,0,1,1,1,1,0,0,0]
new = list()
for i in lst:
    if i not in new:
        new = new.append(i)
print(new)
READ ALSO
Why npm live server reload the page twice?

Why npm live server reload the page twice?

I've just installed the latest version of npm live server but I notice that it reload the page twice when record any change in my html Is that the expected behave or is there any kind of error?

121
PHP insert data into Apache log

PHP insert data into Apache log

I'm wanting to switch to mpm_event to be able to serve a higher rate of requestsThe server is basically just serving files, but there is a php application running on the server

92