Question: ut the following lines into a glowscript script and run them: listof Particles = for i in range(0, 100): posx = 80+(random()-0.5) posy = 80*(random()-6.5)
ut the following lines into a glowscript script and run them: listof Particles = for i in range(0, 100): posx = 80+(random()-0.5) posy = 80*(random()-6.5) posz = 88*(random()-2.5) vx = 100*(randon()-0.5) vy = 100*(randon()-.5) vz = 100*(randon()-0.5) newparticle = sphere(pos-vector(posx, posy, posz), radius=1) newparticle.mass = 1 newparticle.velocity = vector(vx,vy, vz) listOfParticles.append(newparticle) You may want to edit the program to answer the following questions. (a.) What does range(0,100) provide? A list of numbers from 0 to 99. You are correct. Your receipt no. is 148-2910 Previous Tries (b.) What is the minimum value of random()? I recommend reading about random in glowscripts/python's documentation. Otherwise, you'll just be guessing Submit Answer This question expects a numeric answer. Tries 1/99 Previous Tries (c.) What is the minimum y-component of the velocity a particle in listOfParticles may have? Submit Answer Incorrect. Tries 4/99 Previous Tries (d.) What is the piece of the code that adds a particle to the list? listOfParticles.append(newparticle) Your receipt no. is 148-2454 Previous Tries (e.) After the program has gone through the code in the for loop 5 times, how many items (particles) are in listOfParticles? You are correct. Submt Answer Incorrect. Tries 3/99 Previous Tries
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
