Ad
  • Default User Avatar

    The square brackets are actually unnecessary here, without the square brackets you would have what's called a generator expression which works as an iterator on its own. The square brackets are only required when you need to use list functionality, for instance len().

    Just thought I'd tell you because I also did this for quite some time before I learned that you can go without it.