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

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.50 KB  |  hits: 5  |  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. Trailing comma in list not invalid syntax [closed]
  2. >>> ['a','b',]
  3. ['a', 'b']
  4.        
  5. s = ['manny',
  6.      'mo',
  7.      'jack',
  8. ]
  9.        
  10. s = ['manny',
  11.      'mo',
  12.      'jack',
  13.      'roger',
  14. ]
  15.        
  16. s = ['manny',
  17.        'mo',
  18.        'jack',
  19. +      'roger',
  20.   ]
  21.        
  22. s = ['manny',
  23.        'mo',
  24. -      'jack'
  25. +      'jack',
  26. +      'roger'
  27.   ]
  28.        
  29. l1 = [
  30.         1,
  31.         2,
  32.         3,
  33.         4,
  34.         5
  35. ]
  36.  
  37. # Now you want to rearrange
  38.  
  39. l1 = [
  40.         1,
  41.         2,
  42.         3,
  43.         5
  44.         4,
  45. ]
  46.  
  47. # Now you have an error