Question: Define a Python function f(n) which takes as an argument an integer n, and returns an integer. The output of f is required to be
Define a Python function f(n) which takes as an argument an integer n, and returns an integer. The output of f is required to be half n if n is even. If n is odd, define f to be 3n + 1, ie n/2 3n+1 if n even if n odd f(n) On one line, print" (2) (3) s4) /5) r6) /(7, where you replace (n) with the actual output of your function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
