Try this:
def hailstone(start):
num = start
length = 1
while num != 1:
if num % 2 != 0:
num = 3 * num + 1
else:
num = num / 2
length += 1
return (start, length)
for i in range(0,100):
print hailstone(i)
I changed your function so that it remembers the starting value, and then changed the return to send back the starting value and the associated length. Let me know if it works, I can't test it on this computer i'm at right now. Sorry if the formatting is messed up, using crappy windows wordpad.