0

Why does a call to reverse return nothing when put on the end of a list comprehension?

This does not work - lines is None

lines = ['{},'.format(line.replace('"', '').strip().lower()) for line in lines].reverse()

But this works fine - lines is my list in reverse order

lines = ['{},'.format(line.replace('"', '').strip().lower()) for line in lines]
lines.reverse()
fallingdog
  • 192
  • 1
  • 2
  • 17

0 Answers0