The program to simulate rolling five dice 777 times and checking for a Yahtzee is given below.
How to write the programimport random
def check_yahtzee(dice):
"""Check if all five dice have the same value"""
return all(dice[i] == dice[0] for i in range(1, 5))
for i in range(777):
# Roll the dice
dice = [random.randint(1, 6) for _ in range(5)]
# Check for Yahtzee
if check_yahtzee(dice):
print("You rolled {} and it's a Yahtzee!".format(dice))
In conclusion, this is the program to simulate rolling five dice 777 times and checking for a Yahtzee.
Learn more about program on
https://brainly.com/question/26642771
#SPJ1