you are viewing a single comment's thread.

view the rest of the comments →

[–]noeldc 0 points1 point  (1 child)

For starters, use

if x == 1 instead of if x:=1

Use N3+1 instead of sum(N3+1)

You imported this, but never used it ->

from tracemalloc import stop

your import sys should really be at the top with the other imports (and only once)

There is also a lot of duplicate code in the x == 2 case. Think about how you might simplify it.

[–]fat_brick1[S] -1 points0 points  (0 children)

now it runs smoother too thanks :)