索引器错误:列表赋值索引超出范围python3这意味着什么?我如何修复它?

2024-04-19 17:36:34 发布

您现在位置:Python中文网/ 问答频道 /正文

elif letterGuess in letterList: # if the letter is one the word characters
  count = 1
  print (letterGuess, ' is in the word!')
  for n in letterList:
      if n == letterGuess: # replaces the dashes with letters
          dash[count - 1] = letterGuess # takes the dash in position and replaces
      count += 1
  count = 0

这是刽子手守则的一部分。 它说错误在范围之内:

^{pr2}$

Tags: theinifiscountonewordprint