What output will the following Python program produce? n = 10 while n != 1: print (n,) if n % 2 == 0: # n is even n = n // 2 else: # n is odd n = n * 3 + 1
Output:
10
5
16
8
4
2
Tracing:
Get Answers For Free
Most questions answered within 1 hours.