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 it

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 is 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.)

Please do not plagiarize and this is on PYTHON 3.8, thank you!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!