Question: use python 3 please The following flowchart is of a simple program that penerates a list of numbers that explores the Collate Conjecture (Lothar Collatz,
The following flowchart is of a simple program that penerates a list of numbers that explores the Collate Conjecture (Lothar Collatz, 1937) start with any positive integer Nand it is even divide it by 2 but ifodd multiply it by 3 and add 1, then repeat. Eventually, says the conjecture, it will always reach 1, at which point the process stops. Surprisingly, while it always seems to work, the conjecture has never been formally proven. This is also known as the Histones problem, because whenever a power of 2 encountered the sequence immediately halk down to 1. START Variables N INPUTN C=0 PRINT CN FALSE N>1? TRUE C=C+1 FALSE Is N Odd TRUE N=N-2 N=3*N1 PRINT C.N STOP 2030 - Dr. William T. Verts Your Task Your task is to convert the flowchart for that process into a running Python 3 program. All variables are integers First, all of the code that you write must appear inside a function called Mein, with no parameters. The graders will run your program by typing Main at the command prompt. No code will appear outside Second, the input action box is actually more complicated than what is shown here, as it must docard any entered integer value that is less than or equal to zero, and in such cases asks the user for a positive integer again. Your program can only proceed to the next action when the user finally enters a positive integer. Do not use any user defined functions here Do not use exception handing that is, do not use try-except or try-finally in your code: you may assume that users always enter ints and never enters floats or strings. The graders will test your program by entering both zero and negative numbers to see if your program rejects them
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
