python-functions-hw

Needing assistance on explanation and how to come across this problem.

As a reminder, the game is played as follows: roll a six sided die. If you roll a 1, 2 or a 3, the game is over. If you roll a 4, 5, or 6, you win that many dollars ($4, $5, or $6), and then roll again. With each additional roll, you have the chance to win more money, or you might roll a game-ending 1, 2, or 3, at which time the game is over and you keep whatever winnings you have accumulated.

Write three functions for the dice game as well as a main function.

The welcome function has no arguments and no return value. It simply prints a brief welcome to the player.

The rollDie function has one argument, sides, with sides having a default value of 6. The function uses randint, and returns the value of the die roll.

The playGame function has one argument, runs, which represents how many iterations of the simulation should be performed. The function has no return, but it has the bulk of the code needed to play the game, including the printing of results (average and largest winnings). This function should call the welcome function and the rollDie function (let the function use the default number of sides).

Test by calling playGame from main, specifying 10000 runs.

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.