Question: Please use python Write the recursive version of the hailstone. You can assume num is always a positive integer. You must use recursion; the use
Please use python


Write the recursive version of the hailstone. You can assume num is always a positive integer. You must use recursion; the use of global variable and loops is not allowed. The hailstone sequence is generated as follows: if num is even, then the next number in the sequence is num / 2. if num is odd, then the next number in the sequence is 3*num+1. continue this process until num = = 11 def hailstone (num): >>> hailstone(10) [10, 5, 16, 8, 4, 2, 1] >>> hailstone(1) [1] >>> hailstone(7) [7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1] 118
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
