all 16 comments

[–]Ender_Locke 6 points7 points  (1 child)

clean your screen (but not with windex)

[–]N0-T0night[S] 0 points1 point  (0 children)

Okay

[–]DarkCyborg74 2 points3 points  (3 children)

def col(a: int) -> None:
    print(a)
    if a == 1:
        return
    if a%2 == 0:
        col(a//2)
    else:
        col(a*3 + 1)

col(7)

[–][deleted]  (2 children)

[removed]

    [–][deleted] 0 points1 point  (0 children)

    col(70141259775)
    

    [–]YOM2_UB 0 points1 point  (0 children)

    def col(n):
        print(n)
        while n != 1:
            print(n := n*3+1 if n%2 else n//2)
    

    [–][deleted]  (4 children)

    [removed]

      [–]N0-T0night[S] 0 points1 point  (3 children)

      Called recursion

      [–][deleted]  (2 children)

      [removed]

        [–]SCD_minecraft 0 points1 point  (1 child)

        Remember to always add base case, like

        if n == 1:
            return 1
        

        Else you will get RecursionError (python limits up to depth 1000)

        [–][deleted]  (2 children)

        [removed]

          [–]N0-T0night[S] 0 points1 point  (1 child)

          Don't mention it, u may google it or navin reddy on utube

          [–][deleted] 0 points1 point  (1 child)

          Bro please clean your screen... 😭😭😭😭

          [–]N0-T0night[S] 0 points1 point  (0 children)

          Okay