======================
Procedures again
======================

.. qnum::
   :prefix: Procedures-2.
   :start: 1

We have already created procedures. Now to create procedures that we can pass data to.

Big Question
------------
* How can I pass data to a procedure?

Key words
---------
* Procedures
* Parameters

Introduction
------------

So far we have procedures like ``draw_square()``. However we have seen procedures such as ``turtle.forward(100)``, so how do we make it so that we can pass data in such as the ``100`` above. Read on to find out.

Procedures 1
------------

Let us look at some code from before

.. activecode:: procedures-2.1.1
   :nocodelens:
      
   import turtle
   def draw_triangle():
      for i in range (3):
         turtle.forward(50)
         turtle.left(120)
	 
   draw_triangle()

Now let us improve it.

.. activecode:: procedures-2.1.2
   :nocodelens:
      
   import turtle
   def draw_triangle(size):
      for i in range (3):
         turtle.forward(size)
         turtle.left(120)
	 
   draw_triangle()

«Someone should write this.»
