print("You already played %d times, guess the answer at least %d round, guess the answer in an average of %.2f rounds
" % (game_times, min_times, avg_times))
print("Guess a number.")
bingo = False
while bingo == False:
times += 1
answer = int(input())
if answer < num:
print("Too small!")
if answer > num:
print("Too big!")
if answer == num:
print("BINGO! %s is the right answer!"%num)
bingo = True
if game_times == or times < min_times:
min_times = times
total_times += times
game_times += 1
result = "%d %d %d" % (game_times, min_times, total_times)
f = open("gamescore.txt", "w")
f.write(result)
f.close()
跑代码时出现“第18行中未终止的字符串文字”的反馈
希望能有大神指点指点
作者: crossin先生 时间: 2021-11-17 23:49
print("You already played %d times, guess the answer at least %d round, guess the answer in an average of %.2f rounds" % (game_times, min_times, avg_times))