I\'m learning Python for a programming placement test I have to take for grad school, and this is literally the first little script I threw together to get a feel for it. My bac
How about something like this, fairly Pythonic imho:
with open('test.txt') as fh:
for i, line in enumerate(fh):
if i % 2:
nums = map(int, line.split())
print 'Sample size: %d, Results: %d' % (len(nums), sum(nums))
elif line == '0':
print 'End of experiment'