title: using python in maya do for-loop through selected nodes
body: <p>I would like to know a few things here. I'm collecting all the selected nodes using this code snippet below. What I'm now wondering is...</p>
  
  <ol>
  <li>How do I write a for-loop going through each node in the collection?</li>
  <li>How do i get the total number of nodes in the collection?</li>
  <li>How do I get the first node's position in the collection?</li>
  <li><p>How do I get the last node's position in the collection?</p>
  
  <p>nodes = cmds.ls(long = True, selection = True, type = 'dagNode')</p></li>
  </ol>