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
You run an automobile selling company that has a popular online store on AWS. The application sits behind an Auto Scaling group
vredina [299]

Answer:

We can achieve this by using cURL command and GET command.

Explanation:

<u>cURL command: </u>

  • cURL command is the command of the command line tools which are available on the following platforms such as Linux, Windows, Mac OS, and many other Operating Systems.
  • From the servers, cURL transfer the following data by using any of the protocol which are supported such as SFTP, HTTPS, HTTP, FTPS or many of the other protocols.

<u> </u>

<u>GET command: </u>

GET command is the function by which from the particular URL we can retrieve the resources.

8 0
3 years ago
George works for a print newspaper in which of these areas would you be interested to hire new recruits for the newspaper WHICH
Stolb23 [73]

Answer:

number 4

Explanation:

3 0
3 years ago
An online service provider provides its users with hosted computers, an operating system, and a database management system (DBMS
RoseWind [281]

Answer:

The correct option is B: platform as a service (PaaS)

Explanation:

Platform as a service (PaaS) is regarded as a computing model in the cloud and ensures delivery of both software and hardware tools via a third-party provider. Tools delivered are mostly those that are needed for the development of application and are mostly delivers via the internet to its users. Software and hardware tools are usually hosted in the infrastructure of the PaaS provider host and thus this removes the burden on developers of having to install a physical software or hardware in the development or running of a new application.

7 0
3 years ago
Scenes that are shot outside are known as
Maru [420]

Answer:

Location shooting

Explanation:

Most films feature a combination of locations and studio shoots; often‚ interior scenes will be shot on a soundstage while exterior scenes will be shot on location second unit photographs is not considered a location shoot. before filming the location are generally surveyed in pre-production‚

a process known as location scouting and recce.

3 0
3 years ago
In high-tech fields, industry standards rarely change.<br> True <br> False
Sophie [7]

Answer: false

Explanation:

5 0
2 years ago
Other questions:
  • 1. How does inertia affect a person who is not wearing a seatbelt during a collision? 
    14·2 answers
  • he fundamental building block in every Hypertext Markup Language (HTML) document is the _____ tag, which marks a component in th
    7·1 answer
  • Edhesive 3.2 Lesson Practice question 1
    5·1 answer
  • Which device makes computers that are connected to separate segments appear and behave as if they're on the same segment? (Pleas
    11·1 answer
  • Fred wants to analyze his spending habits of the past few years and has gathered information on the checks he has written from 2
    6·1 answer
  • Match the item to the type.
    11·1 answer
  • A company has a website that has seen a large increase in visitors and they are concerned that if the trend continues, the web s
    13·1 answer
  • Which statements are true? Select 4 options.
    9·1 answer
  • An electronics company develops a line of augmented reality headsets for use in interactive 3d media applications using 5g mmwav
    7·1 answer
  • _____ oversee the work of various types of computer professionals and must be able to communicate with people in technical and n
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!