Question
python Goal: we need to be able to roll, count each die and add up their total value. import random def dice_list(): Create and return
python
Goal: we need to be able to roll, count each die and add up their total value.
import random
def dice_list(): """Create and return a list of die faces"""
### YOUR CODE HERE ###
def dice_roll(): """ Return a randomly selected die face from the list of dice faces that is returned from calling dice_list() """ ### YOUR CODE HERE ###
def roll_lots_of_dice(how_many=1): """Return a list of "rolled dice"."""
### YOUR CODE HERE ###
""" Task 1: Create a function that takes in a die face, and returns its INTEGER value. """ def get_dice_value(die_face): """ Returns the INTEGER value of a die face.
Example: -If ".." is passed as argument, then 2 should be returned -If "....." is passed as argument, then 5 should be returned """
### YOUR CODE HERE ###
""" Task 2: Create a function that takes in a LIST of the rolled die faces and returns the sum.
Example: -If ['.', '...'] is passed in, should return 4 -If ['...', '..', '.'] is passed in, should return 6 """ def add_up_rolled_dice_faces(list_of_rolled_faces): """ Returns the sum of a list of rolled die faces."""
### YOUR CODE HERE ###
if __name__ == "__main__":
""" Task 3: Keep asking the user for input (how many dice to roll) until they input 0.
Output the LIST of all the "rolled" die faces each time, and the sum of those dice """
### YOUR CODE HERE ###
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started