Lesson 16 hacks
Vocab
- Simulation: simpler abstraction of a complicated natural phenomena
- Experiment: done in the real world and provide actual results
Notes
- Simulations are safer than experiments, less expensive, repeatable, and can make predictions
- remove details using random numbers
Hacks
Multiple Choice
Question | Answer |
---|---|
Ryan McWeeny | is a genius |
1. | N/A |
2. | N/A |
3. | B |
4. | C |
5. | C |
6. | B |
7. | A |
8. | N/A |
9. | A |
Extra Credit
This simulation find the total result of rolling the inputted number of dice
import random
rollAmount = int(input("how many times would you like to roll?"))
result = 0
for i in range(0, rollAmount):
result += random.randint(1,6)
print("The result of rolling " + str(rollAmount) + " times is: " + str(result))