1 2 3 4 5 6 7 8 9 10 11
x = msg.data[0] steps = 0 while x > 1: steps += 1 if (x % 2) == 0: x /= 2 else: x = 3 * x + 1 return(steps)