A game rule says to divide 24 points by twice the sum of 1 and 3, then add a bonus of 2 cubed points. A programmer writes 24 / 2 * (1 + 3) + 2 ** 3 in Python. Find the score produced by this code and the score intended by the rule. Give both scores in points, to one decimal place.
Unlock full course notes by signing up
Powers, signs and grouping
A game developer checks four Python expressions used for score calculations. Evaluate each expression and complete the table with its exact integer value in points.
A: 2 ** 3 ** 2
B: (2 ** 3) ** 2
Grouping a shared project cost
A project costs 11 dollars for setup plus 7 dollars for supplies. Three groups share the entire cost equally, and each group budgets twice its share. Which Python expressions correctly calculate one group's budget in dollars? Select every correct expression.
Tracking equipment stock
A school equipment program runs the following four lines in a Python script, in the order shown. Complete the table with the exact integer stored in stock after each line executes.
Recovering a starting game score
A game starts with score holding an unknown whole number of points. It then executes these Python statements in order:
After execution, reported holds 64 points. Determine the initial value of score, the final value of score, and the final value of bonus. Give each answer in points as an exact integer.