title: How to get a list of all the legal moves in the python-chess module?
body: <p>I am using the python chess module. On the website, it shows that you can check if a move is legal by using </p>
  
  <pre><code>import chess
  
  board = chess.Board()
  move = input("Enter a chess move: ")
  if move in board.legal_moves:
      # Some code to do if the move is a legal move
  </code></pre>
  
  <p>However, I want to be able to get a move from <code>board.legal_moves</code>. When I try this:</p>
  
  <pre><code>print(board.legal_moves[0])
  </code></pre>
  
  <p>This returns the following error:</p>
  
  <pre><code>TypeError: 'LegalMoveGenerator' object is not subscriptable
  </code></pre>
  
  <p>How can I select a move as if I were using a list? Then, how would I use the selection as a move?</p>