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]
2 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]2 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
A video streaming website uses 32 bit integers to count the number of times each video is played. In anticipation of some videos
Over [174]

Answer:

c) 2^32 times as many values can be represented.

Explanation:

It's funny, this problem comes from a real-life situation, except it wasn't really foreseen :-)  And we will encounter a similar problem in less than 20 years.

The difference in terms of storage capacity from 32-bit integers and 64-bits integers is huge.

A 32-bit integer can store (signed) numbers up to 2,147,483,647. (so over 2 BILLIONS)

A 64-bit integer can store (signed) numbers up to 9,223,372,036,854,775,807 (9 BILLIONS of BILLONS)

5 0
3 years ago
Read 2 more answers
in a stop-and-wait arq system, the bandwidth of the line is 1 mbps, and 1 bit takes 10 ms to make a round trip. if the system da
MArishka [77]

Answer:

٢٣٤

Explanation:

5 0
2 years ago
Select all the correct answers
ikadub [295]
Umm I think 3 and 1
5 0
2 years ago
Which unit of measurement related to quantity
Lisa [10]

Answer:

Unit: A standard quantity against which a quantity is measured [e.g. gram, metre, second, litre, pascal; which are units of the above quantities].

Hope This Helps! :) ;)

Explanation:

Source:

https://www.canterbury.ac.nz/media/documents/science-documents/Measurement.pdf

6 0
3 years ago
Read 2 more answers
Use search engines and websites to research the following WAN technologies to complete the table below:
Yuki888 [10]

Answer:

Explanation:

I am attaching the table as an image with updated table containing required information for the following WAN technologies.

T1/DS1 => Digital Signal 1 (T-Carrier 1),

T3/DS3 => Digital Signal 3 (T-Carrier 3),

OC3 (SONET) => Optical Carrier 3 (Synchronous Optical Networking),

Frame Relay,

ATM => Asynchronous Transfer Mode,

MPLS => Multi-protocol Label Switching,

EPL => Ethernet Private Line.

Although you have mentioned most of the information yourself, there were some wrong data in it.  So I have updated them with correct information in the attached table.

4 0
3 years ago
Read 2 more answers
Other questions:
  • When looking through the documentation for a specific class, you never actually see the source code for that class. Instead, you
    6·1 answer
  • Which of the following takes place during the research phase
    7·1 answer
  • The M:N relationship between STUDENT and CLASS must be divided into two 1:M relationships through the use of the ENROLL entity;
    10·2 answers
  • How do you change the name on your brainly account?
    12·1 answer
  • Computer can do work very___​
    7·2 answers
  • Set screw compression and indenter are all types of
    13·2 answers
  • The {blank} view is the working window of a presentation.
    15·2 answers
  • A DTP firm has published and printed fliers for an upcoming fundraising event. In which section of the flyer would you find the
    10·1 answer
  • What is required to publish documents on the Web
    12·1 answer
  • How does a fully integrated Data and Analytics Platform enable organizations to convert data into consumable information and ins
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!