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
bonufazy [111]
3 years ago
14

Write a function named dice_eval that accepts two parameters representing numeric dice values and returns a string describing th

e results. If the sum of the dice is 7 or 11, return 'Winner!'. If the sum of the dice is 2, 3, or 12, return 'Crxps!'. For all other values, return a string of the form 'Point is xx', where xx is the sum.
Computers and Technology
1 answer:
Zigmanuir [339]3 years ago
4 0

Following are the "dice_eval" method code into python language.

Program Explanation:

  • Defining a method "dice_eval" that takes two variables "d1,d2" in its parametes.
  • Inside the method, multiple conditional statements were used that adds the parameter values and calculates its value which can be defined as follows:
  • In the if block, it adds the parameters and uses or gate that check its value that is equal to 7 or 11. so, it will return a string message that is 'Winner!'.  
  • In the elif block, it adds the parameters and uses or gate that check its value that is equal to 2 or 3 or 12. so, it will return a string message that is ' C r aps ! '.
  • In the else block, it uses a return keyword that adds parameter value and prints a string value.
  • Outside the method "d1,d2" is declared that inputs the value from the user-end, and passes the value into the method, and prints its value.

Program:

def dice_eval(d1, d2):#defining a method dice_eval that takes two parameters

if (d1+d2)==7 or (d1+d2)==11:#defining if block that adds parameter value and use or operator to check its value

return 'Winner!'#return string value

elif (d1+d2)==2 or (d1+d2)==3 or (d1+d2)==12:#defining elif block that adds parameter value and use or operator to check its value

return 'C r aps!'#return string value

else:#defining else block

return 'Point is '+str(d1+d2)#return string value with adding parameter

d1=int(input())#defining d1 that input value

d2=int(input())#defining d2 that input value

print(dice_eval(d1,d2))#calling method and print its return value

Output:

Please find the attached file

Please find the complete code in the attached file.

Learn more:

brainly.com/question/15011927

You might be interested in
Your company has been using Windows workgroups on a server running Windows Server 2016. Due to the rapid growth of the company,
Vesna [10]

Answer:

It is an excellent decision to change to active directory

Explanation:

Active Directory offers the following advantages, for optimal customer response:

Main objects (users, groups, units, organization).

Security (groups, NTFS - permits, audit)

Integration (-windows services, Microsoft applications)

Administration (centralized and delegated)

Scalability (domain, tree, forest)

All the above helps us to control access to files.

3 0
4 years ago
Why is the rate of increasing performance slowing down? Please help
Tcecarenko [31]
What are you trying to say? 

6 0
3 years ago
What are some benefits of web-based applications?
Marina86 [1]

You get results faster

4 0
3 years ago
Read 2 more answers
How many bits are required to write decimal number?
Aleks [24]
There is a amount of 1,00
6 0
3 years ago
Go to the Subset tab, which gives a subset of randomly chosen data from the first tab. Go to your Math Tools and open the Graph
Karo-lina-s [1.5K]

A linear regression model is used to show the relationship between variables on a scatter plot

The equation of the linear regression model is: \^y = 1.56\^x + 1.29 and the correlation coefficient is 0.8034

<h3>How to determine the equation of the linear regression</h3>

The question is incomplete. So, I will make use of a dataset that has the following calculation summary (from a graphing calculator)

  • Sum of X = 45
  • Sum of Y = 83
  • Mean X = 4.5
  • Mean Y = 8.3
  • Sum of squares (SSX) = 82.5
  • Sum of products (SP) = 128.5
  • The value of R is 0.8034.

The equation of the linear regression model is:

\^y = 1.56\^x + 1.29

See attachment for the scatter plot

Read more about linear regression model at:

brainly.com/question/26347582

5 0
3 years ago
Other questions:
  • Why do networks need standards?
    12·1 answer
  • Travel agents are market intermediaries who make their living by gathering, organizing, and dispensing information about travel-
    5·1 answer
  • The number of pixels displayed on the screen is known as ​
    12·1 answer
  • Create a high-level plan to perform a gap analysis for Fullsoft Inc
    7·1 answer
  • A computer reads a sequence from top to bottom and left to right.
    13·1 answer
  • _____ are labels for data, while _____ tie values together into one entity.
    15·1 answer
  • The ______________<br> holds data only while the computer is on.
    7·1 answer
  • _____________ do not contribute to effective group work.
    15·2 answers
  • spreadsheet solution Credit Score Current Rate First Name: Mary 500 6.50% Last Name: Bell 550 6.25% Address: 123 First Street 60
    11·1 answer
  • What will happend when I got a BSOD in Windows?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!