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
Answer: (B) Allow the firewall to accept inbound traffic to ports 80, 110, 143, and 443
Explanation:
Port 80 is used by HTTP, 110 by pop3 to retrieve emails from web servers, 143 by imap for internet messaging and 443 is used for TCP for websites using SSL. So if the firewall is allowed to accept inbound traffic to these ports 80,110,143 and 443 then it would be possible to retrieve emails.
<span>What is the name of the subsystem that transfers data between components inside a pc or between pcs? The Answer is the BUS</span>
Answer:
Explanation:
Determine if the following identifiers are valid. If they are invalid, state the reason. For example, the identifier min value is invalid as it uses a whitespace.
road
mid_point
8ball
break
_log_value
EVERY1
[email protected]
_log
NewNumber
$varA
class
Answer:
The answer to this question is the "SUMIFS" function.
Explanation:
The SUMIFS function is a part of Microsoft Excel. It is used to add the number of multi-criteria cells. This function supports logical operators and wildcards. The main purpose to use this function provides a sum of cells with match multiple criteria. The syntax of this function can be given as:
Syntax:
=SUMIFS (sum_ranges, range_1, criteria_1, [range_2], [criteria_2], ...)
In the above syntax, we use 5 arguments in function that can be defined as:
- The sum_range argument is used to sum of range to be summed.
- The range_1 and range_2 arguments are stands for first and second ranges for evaluating. In which the range_2 can be optional.
- The criteria_1 and criteria_2 is used in range, which are range_1 and range_2.