user input is asked for twice, only accepts second input
<pre><code>def main():
    add_triangle_check = 1
    while add_triangle_check &gt; 0:
        print "test"
        add_triangle()
        add_triangle_check= add_triangle()

def add_triangle():
    add_triangle_check = 0
    user_input = raw_input("Do you want to add more triangles? Y/N")
    if user_input == ("y") or user_input == ("Y"):
        add_triangle_check = 1
    return add_triangle_check

main()
</code></pre>

<p>The above code returns the following:</p>

<blockquote>
  <p>test</p>
  
  <p>Do you want to add more triangles? Y/N</p>
  
  <p>Do you want to add more triangles? Y/N</p>
</blockquote>

<p>why is it repeating? I only need the user input once.</p>