title: Why is my and in a if statement not working?
body: <p>if guess in word:</p>
  <pre><code>    if guess == word[0] and 1 &gt;= len(word):
          print(&quot;Your guess is correct. The letter of the word you guess has been revealed. &quot;)
          right[0] = word[0]
          print(' '.join(right))
          score +=1
      if guess == word[1] and 2 &gt;= len(word):
          print(&quot;Your guess is correct. The letter of the word you guess has been revealed. &quot;)
          right[1] = word[1]
          print(' '.join(right))
          score +=1
          print(score)
      if guess == word[2] and 3 &gt;= len(word):
          print(&quot;Your guess is correct. The letter of the word you guess has been revealed. &quot;)
          right[2] = word[2]
          print(' '.join(right))
          score +=1
          print(score)
      if guess == word[3] and 4 &gt;= len(word):
          print(&quot;Your guess is correct. The letter of the word you guess has been revealed. &quot;)
          right[3] = word[3]
          print(' '.join(right))
          score +=1
          print(score)
      if guess == word[4] and 5 &gt;= len(word):
          print(&quot;Your guess is correct. The letter of the word you guess has been revealed. &quot;)
          right[4] = word[4]
          print(' '.join(right))
          score +=1
          print(score)
  </code></pre>
  <p>The error is:
  if guess == word[1] and 2 &gt;= len(word):
  IndexError: string index out of range</p>
  <p>I think the problem is with the and in the if statement but I dont know.</p>