Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.23 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Someone help me understand the square bracket in the following Python code?
  2. import xlrd
  3. book = xlrd.open_workbook("univ_list.xls")
  4. sh = book.sheet_by_index(0)
  5. for r in range(sh.nrows)[1:]: # line 4
  6.     print sh.row(r)[:4] # line 5