Question: reading the hailstone code n = 4 while n != 1: if n % 2 == 0: # if n is even... n = n


reading the hailstone code n = 4 while n != 1: if n % 2 == 0: # if n is even... n = n / 2 else: n = 3 * n + 1 print n What is the first number that this code will print? 1 N 6 LO 7 programming terminology In the program, what kind of a thing is n % 2 == 0 ? variable operator statement expression Questions how types affect execution # assume Python 2 data = [ 2, 4, 6] total - average - n = 0 for value in data: n - 1 total += value average = total print "average:", average What averages are printed? 1,1,1 1,2,3 O 2, 3, 4 2,4,6 error before the program starts error while the program is running
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
