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:
item = "quesadilla"
meat = "steak"
queso = False
guacamole = False
double_meat = False
base_price = 4.5
if item == "quesadilla":
base_price = 4.0
elif item == "burrito":
base_price = 5.0
if meat == "steak" or meat == "pork":
base_price += 0.50
if meat == "steak" and double_meat:
base_price += 1.50
elif meat == "pork" and double_meat:
base_price += 1.50
elif double_meat:
base_price += 1.0
if guacamole:
base_price += 1.0
if queso and item != "nachos":
base_price += 1.0
print(base_price)
Explanation:
- Use a conditional statement to check if meat is steak or pork then add 0.50 to base_price
.
- Check if the meat is steak or pork, then double_meat adds 1.50 or 1.0 otherwise
.
-
Check if meat is steak and its double_meat
, then add 1.50 and if its for guacamole, then add 1.00 to base_price
. If queso is there and item is not nachos, add 1.00 to base_price
.
- Finally when item is nachos, no need to add any money to base_price
.
Answer: Ethics
Explanation:
Ethics is the basic principle for the personal code. The code of the ethics is basically designed for outline the values in the organization with honesty and integrity.
The ethics is basically depend upon the principle of core value of the organization. The code of the ethics basically guide the core value in the organization and breaking the rule of ethics can also cause termination from the organization.
Morality, integrity and honesty are all the sub part of the ethics vale in the organization. Therefore, ethics is the correct option.
Answer:
Click on the New Slide icon. 2.
Enter the slide position desired. N/A
Click where you want to add the slide. 1.
Select New Slide from the Tools menu. 3.
Switch to the Normal or Slide Sorter view. 4.
Switch to the Notes or Outline view. 5.
Explanation:
You can never enter the slide position desired, and you need to click on the slide after which you want the new slide to be placed. Thus, enter the slide position desired is not applicable, and you need to click where you want to add the slide, and more accurately after which. Hence, this is the 1st. Now you need to click on the new slide icon. Then you need to select the new slides from the tools menu. The slide will appear in Normal view, and you can design the slide now as well as add the notes. You can then move to slide sorter view to arrange the slides, or you can arrange from the slide tab as well. Finally to check(edit) the notes and outline you can change the view to notes or Outline view. Hence, the above answer.
Keep in mind that through presenter view, you can make the slide show where you can see the slides and your notes, and the listeners can see the slides only.