Why is my method returning None?
<p>I have the following method call:</p>

<pre><code>NCOLS = 3        
NPEGS = 4 

first_guess = []

print("calling first guess method")
first_guess = firstGuess(NCOLS, NPEGS, first_guess)
print("after method call: " + str(first_guess))
</code></pre>

<p>firstGuess method:</p>

<pre><code>def firstGuess(NCOLS, NPEGS, first_guess):
"""Used for setting up the first guess of the game"""
  print("in firstGuess method")
  for c in range(1, NCOLS + 1):
     if len(first_guess) == NPEGS:
         print("about to return first guess: " + str(first_guess))
         return first_guess
     else:
         first_guess.append(c)

  print("out of for loop, first_guess len is " + str(len(first_guess)) + ", " + str(first_guess))
  if len(first_guess) &lt;= NPEGS: #there were less color options than pegs
     firstGuess(NCOLS, NPEGS, first_guess)
</code></pre>

<p>This seems to be returning <code>None</code> for a reason I cannot figure out.</p>

<p>Here is my output:</p>

<pre><code>calling first guess method
in firstGuess method
out of for loop, first_guess len is 3, [1, 2, 3]
in firstGuess method
about to return first guess: [1, 2, 3, 1]
after method call: None
Traceback (most recent call last):
File "mastermind.py", line 323, in &lt;module&gt;
sys.exit(main())
File "mastermind.py", line 318, in main
playOnce()
File "mastermind.py", line 160, in playOnce
first_guess = first_guess + str(g[0][i])
TypeError: 'NoneType' object is not subscriptable
</code></pre>

<p>Why is it returning <code>None</code> instead of <code>[1, 2, 3, 1]</code>?</p>
