Transforming a list of data in Python

From XPUB & Lens-Based wiki
Revision as of 14:00, 5 April 2011 by Michael Murtaugh (talk | contribs) (Created page with "Exercise to be typed in ipython. <source lang="python"> range(100) data = range(100) for d in data: print d for d in data: print d*17 pp = [] for d in data: pp.a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Exercise to be typed in ipython.

range(100)

data = range(100)

for d in data:
    print d

for d in data:
    print d*17

pp = []
for d in data:
    pp.append(d)
pp

pp = []
for d in data:
    pp.append(d*17)
pp