Question: Using Python, Write a function named collatz() that has one parameter named number. If number is even, then collatz() should print number // 2 and
Using Python, Write a function named collatz() that has one parameter named number. If number is even, then collatz() should print number // 2 and return this value. If number is odd, then collatz() should print 3 * number + 1. Then write a program that lets the user type in an integer and that keeps calling collatz() on the number until the function returns the value 1. Submit the code and the screenshot using Linux.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
