/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Free solutions & answers for Python Crash Course: A Hands-On, Project-Based Introduction to Programming Chapter 15 - (Page 1) [step by step] | 91Ó°ÊÓ

91Ó°ÊÓ

Problem 1

Cubes: A number raised to the third power is a cube. Plot the first five cubic numbers, and then plot the first 5000 cubic numbers.

Problem 4

Modified Random Walks: In the class Randomwalk, x_step and Y_step are generated from the same set of conditions. The direction is chosen randomly from the list \([1,-1]\) and the distance from the list \([0,1,2,3,4]\). Modify the values in these lists to see what happens to the overall shape of your walks. Try a longer list of choices for the distance, such as 0 through 8 , or remove the \(-1\) from the \(x\) or \(y\) direction list.

Problem 6

Automatic Labels: Modify die.py and dice_visual.py by replacing the list we used to set the value of hist.x_labels with a loop to generate this list automatically. If you're comfortable with list comprehensions, try replacing the other for loops in die_visual.py and dice_visual.py with comprehensions as well.

Problem 7

Two D8s: Create a simulation showing what happens if you roll two eight-sided dice 1000 times. Increase the number of rolls gradually until you start to see the limits of your system's capabilities.

Problem 8

Three Dice: If you roll three D6 dice, the smallest number you can roll is 3 and the largest number is 18 . Create a visualization that shows what happens when you roll three D6 dice.

Problem 9

Multiplication: When you roll two dice, you usually add the two numbers together to get the result. Create a visualization that shows what happens if you multiply these numbers instead.

Access millions of textbook solutions in one place

  • Access over 3 million high quality textbook solutions
  • Access our popular flashcard, quiz, mock-exam and notes features
  • Access our smart AI features to upgrade your learning
Access millions of textbook solutions in one place

Recommended explanations on Computer Science Textbooks