import random
#set counters
counter2=0
counter3=0
counter4=0
counter5=0
counter6=0
counter7=0
counter8=0
counter9=0
counter9=0
counter10=0
counter11=0
counter12=0
doubles=0
def main():
#get input from user
rolls = int(input("How many times would you like to roll the dice?")
for count in range(rolls+1)
#roll dice
die1 = random.randint(1,6)
die2 = random.randint(1,6)
#add up dice totals to counters
if die1 + die2 = 2:
counter2 += 1
if die1 + die2 == 3:
counter3 += 1
if die1 + die2 == 4:
counter4 += 1
if die1 + die2 == 5:
counter5 += 1
if die1 + die2 == 6:
counter6 += 1
if die1 + die2 == 7:
counter7 += 1
if die1 + die2 == 8:
counter8 += 1
if die1 + die2 == 9:
counter9 += 1
if die1 + die2 == 10:
counter10 += 1
if die1 + die2 == 11:
counter11 += 1
if die1 + die2 == 12:
counter12 += 1
if die1 == die2:
doubles += 1
#print data
print("2 - ", counter2, \
"3 - ", counter3, \
"4 - ", counter4, \
"5 - ", counter5, \
"6 - ", counter6, \
"7 - ", counter7, \
"8 - ", counter8, \
"9 - ", counter9, \
"10 - ", counter10, \
"11 - ", counter11, \
"12 - ", counter12, \
"Doubles - ", doubles)
main()
このプログラムの目的は、2 つのサイコロをユーザーが望む回数だけ振ってから、サイコロが 1、2、3、4 などを何回振ったかをリストすることです。行 "die1 = random.randint(1,6)そして die2 = random.randint(1,6) は構文エラーを与え、「die1」の心を強調して、私が間違っていることを教えてくれますか?