Generate a random number

Assignment Help Business Management
Reference no: EM132170363

Python For Loops - Version 3

User will roll 5 dice with the goal of getting 5 of a kind within 4 rolls. The resulting number on each die will be generated randomly.  User can use the "random" module to cbetween 1 and 6. You can read about the random module in the Python documentation.The way you will use it is something like random.randint(a, b). 

The user will decide which of the values they want to keep out of the current roll. For instance if the current roll is (2, 3, 2, 1, 6), the user may specify that they wish to keep the 2's. In this case, in the dice that do not contain the value 2 will be rolled again.   If the player does not have 5 of a kind after 4 rolls, inform them that they have lost the game and ask if they would like to play again. If they have 5 of a kind, inform them that they have won the game.  Remember, the user may change their mind as to which values to keep so it shouldn't be assumed that they are trying for the same value for all 4 rolls. At each roll, your program should show the current value of each die. For instance, the program might look like this:

Hi, welcome to Yat!  

Your first roll is:  5, 6, 1, 5, 5

Which value you would like to keep? 

5

Your second roll is: 5, 5, 6, 5, 5

Which value would you like to keep?

5

Your third roll is: 5, 5, 5, 5, 5

You WIN!

Would you like to play again? Please enter Y (yes) or N (no) etc...

Reference no: EM132170363

Questions Cloud

Design a campaign sign : Design a campaign sign. Which state or local newspaper, official, celebrity endorsements will you seek? Why?
What is the warburg effect : Cancer cells have a different mode of metabolism than normal cells. What is the Warburg effect and how much energy does it generate compared to normal aerobic.
How historical thought and tradition affect civil liberties : The Digital Age is having a profound effect on the privacy of individuals in both their daily and private lives.
Find someone whose health has been impacted : For each of the determinants of health that you have learned: 1) Policy, 2) Health Services, 3) Behavioral Choices, 4) Social Determinants, and 5) Biology.
Generate a random number : User will roll 5 dice with the goal of getting 5 of a kind within 4 rolls. The resulting number on each die will be generated randomly.
What you began to complete the project : In Week 5 you submitted your project topic submission as a short presentation. In Week 7, you will pick up on what you began to complete the project.
Effectively implement a policy framework : In order to effectively implement a policy framework, what three organizational elements are absolutely needed to ensure successful implementation?
Describe a methodology for examining internet : Describe a methodology for examining Internet use history on a Windows PC. This should be a step-by-step description of a process.
Discuss how the web portal features and elements : Discuss how the web portal features and elements will help you to advance your e-business.

Reviews

Write a Review

Business Management Questions & Answers

  Summarize the current organizational training program

Present an idea for a new training program or component to the existing training program which would promote employee engagement

  What is the total cost of policy

?a) How many tires should Rocky Mountain order each time it places an? order?

  What processes does the organization have to motivate staff

What processes does the organization have to motivate staff? Do these process work? Why? What would you change in the organization to improve employee's motivation

  How should you act in the given situations

In light of what you have learned in this chapter, how should you act in the following situations? Are the actions legal or illegal?

  Describe the importance of auction mechanisms

Describe the importance of auction mechanisms and their use in strategic decisions related to negotiations and monopoly markets.

  My favorite daily deals web sites

Your page should contain the heading "My Favorite Daily Deals Web Sites."

  Expound upon demographic and other institutional factors

Expound upon demographic and other institutional factors that are relevant to your issue; and Decide upon at least three objectives for the solution so you can measure whether you accomplished this by the end of the course.

  List and briefly describe the four methods of promotion

How can promotion be used when introducing a new product? What is the promotion mix? List and briefly describe the four methods of promotion?

  Describe the three types of supply under the gst australia

Goods and services tax (GST), which was introduced in July 2000, is a broad-based tax of 10% of most goods, services and other items sold or consumed

  Calculate the probability that the project

(a) Calculate the probability that the project will be completed in 38 weeks.

  Identify one of the major human resource management

Identify one of the major Human Resource Management (HRM) Laws. How has the law impacted employees and or organizations.

  Organizational change model

There are many different models of organizational change. Each has advantages and disadvantages. It is up to the organizational development specialist to match the specific model to the current needs of the organization.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd