Probability Calculator - Copy Function Questions

I’m doing the probability calculator challenge in the scientific computing course, and the top of the file says:

import copy
import random
# Consider using the modules imported above.

I’m well aware of why I would use random in this course, but I had to look up copy. I’m familiar with the pass-by-copy and deep-copy concepts, but I’m not sure how they would apply to this challenge and wanted to ask the experts before getting myself into too much trouble.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0

Challenge: Probability Calculator

Link to the challenge:

Have you read the whole project specification in file?

Generally I’d suggest not to worry too much about finding usage for the copy module at the start of project.

It took me a while, but I got to the def experiment part, and the README file include the following list item:
hat: A hat object containing balls that should be copied inside the function.
The fact that it says the hat should be copied in the function sounded like a flag to me, but I want to be sure when to copy and whether or not to deep-copy.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.