1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Reil [10]
3 years ago
11

The game begins with the player having 20 POINTS

Computers and Technology
1 answer:
kompoz [17]3 years ago
8 0

Answer:

Following are the code to this question:

import random#import package for using random method  

def rolling_dice(): #defining method rolling_dice that uses a random number to calculate and add value in dice1 and dice2 variable

   dice1 = random.randint(1,6)

   dice2 = random.randint(1,6)

   return dice1 + dice2

def rolling(): # defining method rolling

   n_roll = 0  # defining num variable that initial value that is 0.

   p = 20 # defining variable p for looping, that points in between 1 and 59

   while p > 0 and p < 60: # defining loop that counts value dice value two times  

       d = rolling_dice()#defining d variable that hold method value

       n_roll+= 1 #defining n_roll that increment n_roll value by 1

       if d == 7 or d == 11:# defining if block that uses the d variable that checks either 7 or 11, player won d in p variable

           p+= d   # use p variable that adds d variable

       elif d == 2 or d == 3 or d == 12:#defining elif block to that checks d variable by using or operator  

           p-= d#defining d variable that decreases d variable variable

       else: # defining else block

           p1 = d # using p1 variable that store d value  

           while True:# defining loop that calculates values

               d = rolling_dice()#defining d variable that holds method values

               n_roll += 1 #increment the n_roll value by 1

               if d == 7:#defining if block that checks d value equal to 7

                   p -= p1#subtract the value of p1 in p variable  

                   break # exit loop

               elif d == p:#defining elif block to check d value is equal to p

                   p += p1#adds the value of p1 in p variable  

                   break#using break keyword

   if p<= 0:#defining if block that checks p-value is less then equal to 0  

       print('Player lost')#using print method

   elif p>= 60:#defining else block that checks p-value is greater than equal to 60

       print('Player won')#using print method to print the value

   print('number of dice rolls:', n_roll)#use print method to print n_rolls value

rolling()

Output:

Player lost

number of dice rolls: 38

Explanation:

In the above-given python code, a method "rolling_dice" is declared, inside the method two-variable "dice1 and dice2" is declared, that uses the random method to calculate the value in both variable and use the return keyword to add both values.

  • In the next step, another method the "rolling"  is declared, inside the method "n_roll and p" is declared that assigns the values and use the two while loop, inside the loop if block is defined that calculates the values.
  • In the next step, a condition block is used that stores value in the p variable and use the print method to print the "n_roll" value.  
You might be interested in
What doe the &amp; operator do in python programming software
ArbitrLikvidat [17]
Hardware software is the answer
5 0
3 years ago
What are the main components of a desktop PC and briefly describe their purposes.​
Norma-Jean [14]

Answer:

8 Standard Computer Components and What They Do

Explanation:

Motherboard. The motherboard is an important computer component because it’s what everything else connects to!

Power Supply. True to its name, the power supply powers all other components of the machine.

Central Processing Unit (CPU)

Random-access Memory (RAM)

Hard Disk Drive / Solid State Drive.

Video Card.

Optical Drives.

6 0
2 years ago
For each of the users of accounting information, identify whether the user is an external decision maker (E) or an internal deci
jarptica [38.1K]

Answer:

Customer (E), Company manager (I), Internal Revenue Service (E), Lender (E), Investor (E), Controller (I), Cost accountant (I), SEC (E).

Explanation:

First of all, we need to define what exactly is an External Decision Maker (E) and an Internal Decision Maker (I).

External Decision Makers, these are people <u><em>outside the company</em></u><em> </em>that make decisions, for example: Customer, Internal Revenue Service, Lender, Investor and The U.S. Securities and Exchange Commission (SEC).

<u>Customers</u> are external because they don't belong to the company.

<u>Internal Revenue Service </u>is an institution of the  Government of the U.S., that's why is outside the company.

<u>Lender</u>, this person or financial institution is not involved in the company in self, only lends money to the company, that's it.

<u>Investor,</u> as it was said above, it's the person or institution that only lends the money to the company, without being part of the insides.

<u>The U.S. Securities and Exchange Commission (SEC)</u> is an institution of the U.S. Government, so it's outside the company.

Internal Decision Makers, these are people inside the company, they are absolutely involved in the direct decisions, for example, Company Manager, Controller and Cost Accountant.

<u>Company Manager</u> is the head of the company, the person in this position absolutely makes company decisions to coordinate all departments.

<u>Controller</u>, this person has the responsibility of all accounting related activities, that's why is an internal decision maker.

<u>Cost Accountant,</u> is an internal decision maker because is the person in this position has to be a financial specialist who determines costs of the products or services that the company offers.

So, there you have it, it's a pleasure to help.

4 0
3 years ago
What process does a system use to officially permit access to a file or a program CIS 502 ?
ipn [44]

Answer:

Authorization                                

Explanation:

Authorization is a security process to determine access levels related to system resources such as files, services, computer programs, data and application features. This is the method of allowing or denying access to a resource which enables the user to get access to various services and resources depending on the user's identity.

Authorization is the process that checks if a user has the permission to get access to a particular file or perform a particular action, ensuring that user has successfully authenticated himself. It refers to defining access policy.

For example a system administrator determines for the system device, in multi-user computer systems, which users are granted access to system and its resources and privileges are granted.

4 0
3 years ago
Plagiarism allowed 5%<br><br>Best Answer gets extra points
kherson [118]

ysoudoshzmzbzb.

Explanation:

》☆♡☆□☆♡▪︎□hx I xnbxjxozkx

7 0
3 years ago
Read 2 more answers
Other questions:
  • Cari brought 2 pounds of grapes at the grocery store she ate 5 ounces of the grapes on way home what is the weight of the grapes
    12·1 answer
  • Write a function in MATLAB that takes as an input a matrix of coefficients for a system of linear equations (A), the solution ve
    15·1 answer
  • Do Violent Video Games Make People More violent in Real Life ?
    14·1 answer
  • After a chart has been inserted and formatted, is it possible to change the data range it refers to or to add new rows of data?
    14·1 answer
  • If you wish to sign out of your Microsoft account, tap or click ____ on the ribbon to open the Backstage view and then tap or cl
    8·1 answer
  • Which statement is true of Web-based social media?
    12·1 answer
  • Emma lives in Pennsylvania, what climate does she live in?
    7·1 answer
  • Why are object-oriented languages very popular?
    11·2 answers
  • Tom teaches in a high school. He wishes to sort a spreadsheet containing students' marks in various subjects by descending order
    14·1 answer
  • It is a single strand of metal capable of transmitting power or data from one area to<br> another
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!