Question: easy code snippet. double checking my answer What gets printed if the function: lastFun() is called with n = 10? def lastFun(n): sequence = [n]

easy code snippet. double checking my answer
easy code snippet. double checking my answer What gets printed if the

What gets printed if the function: lastFun() is called with n = 10? def lastFun(n): sequence = [n] while n!= 1: if n %2 == 0: n= n/2 else: n=3* n + 1 sequence.append(n) print(sequence) (10, 10, 10, 10, 10] (10, 31, 15, 7, 3, 1) [10, 1, 2, 3, 4, 5, 1] [10, 5, 16, 8, 4, 2, 1)

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!