Lesson 18: Dice Game Simulation in Python
March 11, 2020
Review:
- Quiz 08
- Coin Toss simulation
- Stock Market Simulation Project
- Protocol for possible campus closure and remote learning
- Check course page for announcements
- Conference calling and screen sharing in place of lecture
Presentation:
- Generating Random Numbers in Python
- Discrete Simulation with randint(min, max)
- Dice Game Simulation
Activity:
- Create your own Dice Simulation on Repl.it
- Simulate “Pass”, a simplified version of Craps
- Rules of Pass
- Player rolls a pair of six-sided dice and…
- wins if the roll is 7 or 11
- loses if the roll is 2, 3 or 12
- ties if the roll is 4, 5, 6, 8, 9 or 10
- Player rolls a pair of six-sided dice and…
- Simulate 100 games
- Calculate % wins, % losses and % ties
Assignment:
- Complete the Stock Market Simulation Project
- Recommended: Intermediate Python (DataCamp)