Question: Ask user to type a positive integer and call it n . If n is even, divide it by two. If n is odd, multiply
Ask user to type a positive integer and call it n. If n is even, divide it by two. If n is odd, multiply it by three and add one. Continue this process until n is equal to one.
The user input must be a positive number that not equal to 1. You must have an integer variable call counter, which starts with 0, and add one to its value every while loop runs.
The if statement to check if a number is even (tell me how to check is a num is odd?)
Python 3.8, and Thank you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
