Python 3.3 vs. MSDOS Basic

Olive diolu.remove_this_part at bigfoot.com
Tue Feb 19 09:02:40 EST 2013


> max=0
> m=0
> while m<=1000000:
>     m+=1
>     count=0
>     n=m
>     while n!=1:
>         count+=1
>         if n%2==0:
>             n=n//2
>         else:
>             n=3*n+1
>     if count>max:
>          max=count
>          num=m
> print(num,max)
> 

I have tried to run your program with pypy (Python git compiler) (http://pypy.org/), it runs about 15x faster (8 sec instead of 2m2sec in my old Celeron M420 computer).

Olive




More information about the Python-list mailing list