Question: For python programming: Your task is to fix the functions in the template code main.py Each function contains at least one error. These can be
For python programming:

Your task is to fix the functions in the template code main.py Each function contains at least one error. These can be errors that make Python fail (sometimes only in edge or corner cases) or they might contain logic errors that produce wrong results. 1. Read the documentation for each function carefully - the doc string will tell you what the function is supposed to do. 2. Read the code. 3. Run the test cases to observe failures. 4. Fix the function. 282326.1742132 LAB ACTIVITY 18.4.1: Bug hunt 0/50 main.py Load default template... 1 # bug hunt 2 # 3 # Fix each function so that it does what the doc string claims. 4 # Functions may contain multiple errors. 5 6 z 7 def countdown(): """Returns a list with numbers counting down from 10 to 6""" last = 0 10 count 10 11 numbers 12 while count > last: 13 numbers.append(count) 14 count -= 1 * 16 def YZ0(theta, phi): 17 """"Spherical harmonic Y20 for l=2, m=0 for angles theta and phi. 18 19 See e.g. https://mathworld.wolfram.com/Spherical Harmonic.html Eq. 24 20 main.py Load default template... * 1 # bug hunt 2 # 3 # Fix each function so that it does what the doc string claims. 4 # Functions may contain multiple errors. 5 6 b 7 def countdown: 8 "Returns a list with numbers counting down from 10 to """ a 9 last = 0 10 count = 10 11 numbers = [] 12 12 while count > last: 13 numbers.append(count) 12 14 count -= 1 15. 15 10 16 def Y20(theta, phi): 17 "***"Spherical harmonic Y20 for 1=2, m=0 for angles theta and phi. 10 18 10 19 See e.g. https://mathworld.wolfram.com/Spherical Harmonic.html Eq. 24 20 21 21 0.25 * math.sqrt(5/math.pi) * (3 * math.cos(theta)**2 - 1) 22 23 73 24 24 def jacobsladder(top): 25 ""Returns a list with numbers with increasing step size up to 'top'. 26 27 The ladder starts at 0 and the stepsizes increase by 1 for each 28 step, starting with stepsize 1. For example, for top = 10 you 29 should get 30 31 [0, 1, 3, 6, 10) 32 33 34 x = 0 35 step = 1 36 numbers = 0 37 while x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
