Question: Simulate multiple walks A single random walk is one thing, but that doesn't tell you if you have a good chance at winning the bet.
Simulate multiple walks
A single random walk is one thing, but that doesn't tell you if you have a good chance at winning the bet.
To get an idea about how big your chances are of reaching steps, you can repeatedly simulate the random walk and collect the results. That's exactly what you'll do in this exercise.
The sample code already sets you off in the right direction. Another for loop is wrapped around the code you already wrote. It's up to you to add some bits and pieces to make sure all of the results are recorded correctly.
Note: Don't change anything about the initialization of allwalks that is given. Setting any number inside the list will cause the exercise to crash!
Instructions
XP
Fill in the specification of the for loop so that the random walk is simulated five times.
After the randomwalk array is entirely populated, append the array to the allwalks list.
Finally, after the toplevel for loop, print out allwalks.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
