title: Python 3 Simon Says For Loop String Comparison
body: <p>I'm new to python 3 and I feel like I am learning in the worst way possible. Everything is through an online text-book called zybooks. I've been trying to understand for loops, and for the program I am supposed to write I have to use for loops. </p>
  
  <p>here are the instructions: "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares the two strings. For each match, add one point to user_score. Upon a mismatch, end the game. Ex: The following patterns yield a user_score of 4:</p>
  
  <p>simonPattern: R, R, G, B, R, Y, Y, B, G, Y</p>
  
  <p>userPattern:  R, R, G, B, B, R, Y, B, G, Y</p>
  
  <p>to start I am given this:</p>
  
  <pre><code>user_score = 0
  simon_pattern = 'RRGBRYYBGY'
  user_pattern  = 'RRGBBRYBGY'
  print('User score:', user_score)
  </code></pre>
  
  <p>I have passed the first "test" with this code:</p>
  
  <pre><code>user_score = 0
  simon_pattern = 'RRGBRYYBGY'
  user_pattern  = 'RRGBBRYBGY'
  for simon_pattern in str(simon_pattern):
      for user_pattern in str(user_pattern):
          if str(simon_pattern) == str(user_pattern):
              user_score += 1
              continue
          if str(simon_pattern) != str(user_pattern):
              break
  print('User score:', user_score)
  </code></pre>
  
  <p>the problem is when it goes to do the second test my output is still User score: 4 instead of User score: 7 (the strings for simon_pattern and user_pattern change for the second test.)</p>
  
  <p>I know I need to compare each element in the string to each other one at a time and add +1, and as soon as two elements don't match my loop needs to stop. I have tried:</p>
  
  <pre><code>user_score = 0
  simon_pattern = 'RRGBRYYBGY'
  user_pattern  = 'RRGBBRYBGY'
  for s in simon_pattern:
      for u in user_pattern:
          if simon_pattern [0] == user_pattern [0]:
              user_score += 1
          if simon_pattern [0] != user_pattern [0]:
              break
          if simon_pattern [1] == user_pattern [1]:
              user_score += 1
          if simon_pattern [1] != user_pattern [1]:
              break
  </code></pre>
  
  <p>(and then I continue the above loops until I get to [9] and print the user_score, but that doesn't work, either.) </p>
  
  <p>I've tried comparing len(simon_pattern) to len(user_pattern) but that just throws back an error telling me that it can't perform that function because I have strings and not integers. </p>
  
  <p>I'm wondering if someone can tell me what I'm doing wrong or point me in the right direction. Because at this point I don't know what I'm doing wrong and why. I'm sorry this is really long, but I wanted to explain as thoroughly as I could. Thank you for your help.</p>