Python: If elif
<p>i am trying to create a function that creates an empty coloured picture given the numbers of tiles from createSquareTile(numTiles, prefix)</p>

<pre><code>def createSquareTile(numTiles, prefix):
  current = 1
  if current == 1:
    numTiles = requestNumber("Please input a positive number")
    numTilesI = int(numTiles)

    while (numTilesI &lt; 0):
      showError("Your input number" + str(numTiles)+ "is not valid. Do it       again!")
      numTiles = requestNumber("Please input a positive number")

    if (numTilesI &gt; 0):
    current = current + 1
    color = pickAColor()
    return makeEmptyPicture(numTilesI), numTilesI), color)

  elif current &gt; 1:
    previousChoice = requestString("Same size as pervious tile? (Y/N)")

    while (previous != "N") and (previous != "Y"):
      showError("Your input character" + previousChoice + "is not valid. Do it again!")
      previousChoice = requestString("Same size as previous tile? (Y/N)")

    if (previousChoice == "Y"):
      color = pickAColor()
      return makeEmptyPicture(numTilesI, numTilesI, color)
      current = current + 1


    elif (previousChoice == "N"):
      numTilesN = requestNumber("Please input a positive number")
      numTIlesNI = int(numTilesN)
      colorN = pickAColor()
      return makeEmptyPicture(numTilesNI, numTilesNI, colorN)
      current = current + 1
</code></pre>

<p>According to python, there was a spacing error at</p>

<pre><code>elif current &gt; 1:
</code></pre>

<p>Could somebody please help me what is wrong with my elif statement? Thanks in advance!</p>

<p>here is your issue:
    return makeEmptyPicture(numTilesI), numTilesI), color)</p>

<p>you should remove the <code>)</code> from <code>numTilesI), color)</code> and should work because actually your program stops at this line and not moving forward. Performed debug and checks out: </p>

<blockquote>
  <p>Connected to pydev debugger (build 162.1967.10)
  Process finished with exit code 0</p>
</blockquote>

<p><strong>correct will be:</strong>
    makeEmptyPicture(numTilesI), numTilesI, color</p>

python if-statement while-loop