Answer:
The solution code is written in Python 3.
Explanation:
A Random generator is needed for this question and therefore we start by importing Python random class (Line 1)
Next, create one counter variable, count, to ensure there will be only three rolling of the dices (Line 3). We need another variable, flag, to track the status if the two dices equal to the guess number chosen by user (Line 4).
Next, prompt use to input a guess number (Line 5).
Within the while loop, we can use random class method randint() to generate random integer. The arguments 1 and 7 will give one random number ranged from 1 to 6 for dice1 and dice2, respectively (Line 8 - 9).
If the total of dice1 + dice2 equal to user guess, we turn the flag to True. If not, the flag will remain False after completing entire while loop.
If the flag turned to True, print the message "User Wins!" else print the message ("Computer wins!")