Guest User

Untitled

a guest
May 14th, 2010
145
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #1 variant
  2. a = range(1,10)
  3. for i in a:
  4.     rev = (-1,1)[i % 2]
  5.     print " ".join(map(str, a[:i][::rev]))
  6.  
  7. #2 variant    
  8. d = [[str(j) for j in a[:i][::(-1,1)[i % 2]]] for i in a]
  9. print "\n".join([" ".join(j) for j in d])
RAW Paste Data