title: Using the turtle package, is it possible to create a function asking for an argument? (And then use it for the .onkeypress method)
body: <p>I tried myself at making the Pong project using the turtle package on Python.</p>
  <p>I know how to make the code work (using 4 different functions taking no arguments, for each paddle and directions), but my question is if and how can I do it with this idea.</p>
  <p>Here's the code I'm attempting to make work :</p>
  <pre><code>def move_paddle_up(paddle):
          y = paddle.ycor()
          y += 20
          paddle.sety(y)
      
  def move_paddle_down(paddle):
          y = paddle.ycor()
          y -= 20
          paddle.sety(y)
  
  #Keyboard binding movement
  screen.listen()
  screen.onkeypress(move_paddle_up(left_pad), &quot;w&quot;)
  screen.onkeypress(move_paddle_down(left_pad), &quot;s&quot;)
  screen.onkeypress(move_paddle_up(right_pad), &quot;Up&quot;)
  screen.onkeypress(move_paddle_down(right_pad), &quot;Down&quot;)
  </code></pre>
  <p>When the screen is launched, the paddles won't move if I press the associated keys.</p>
  <p>With the way of using the 4 different functions, it works.</p>
  <p>It's just that I am curious to know how I should call or define the arguments in such a function.</p>