Show how a projectile (turtle) travels over time
<p>I am new to Python, and currently having a rough time with turtle graphics. This is what I am trying to solve</p>

<blockquote>
  <p>On Turtellini (the planet where Python turtles live) the
  transportation system propels turtles with a giant slingshot. A
  particular turtle's original location (x0, y0) is (-180, -100). He is
  then shot upward at an initial vertical velocity (vy) of 88 units per
  second and a horizontal velocity (vx) of 20 units per second to the
  right. He travels for 16 seconds. The acceleration due to gravity (g)
  is 11 units per second squared. The the location of the turtle at a
  given second (t) is calculated as follows: x = x0 + vx * t and y = y0
  + vy * t - g/2 * t2 . This program is to show how a turtle travels over this period of time.</p>
</blockquote>

<p>The output should be like this:</p>

<p><img src="http://i.stack.imgur.com/7sqkv.jpg" alt="Output Image"></p>

<p>Here is what I should do;</p>

<ul>
<li>set up the constants (vertical velocity, horizontal velocity,
gravity) and variables (x and y coordinates) set up the turtle by
giving him a proper shape, putting his tail up, moving him to the
initial position, putting his tail down make a loop that repeats for
seconds 1 through 16 inclusive. in each iteration of the loop display
the the values of the x and y variables (in the shell window), move
the turtle to those coordinates, have the turtle stamp his shape,
calculate the new values for the x and y variables after the loop
terminates, move the turtle to the last calculated coordinates,
change his color, and stamp his shape, then wait for a mouse click</li>
</ul>

<p>My code so far:</p>

<pre><code>import turtle

def main():
    wn = turtle.Screen()
    turtellini = turtle.Turtle()
    t = int(input("Blab blab blab: "))
    x0 = -180
    y0 = -100
    vx = 20
    vy = 88
    g = 11
    x = (float(x0 + vx * t))
    y = (float(y0 + vy * t - g / 2 * t**2))
    turtellini.color("black")
    turtellini.shape("turtle")
    turtellini.up()
    turtellini.goto(-180,-100)
    turtellini.down()
    for i in range(1,16,1):
        turtellini.stamp()
        turtellini.forward(i)
        turtellini.right(i)
    print(x)
    print(y)
if __name__ == "__main__":
    main()
</code></pre>

<p>I know I am doing bad; but can anyone help me to solve this problem?</p>

<p>You seem to have most of the parts and pieces.  The biggest issue I see is you didn't put your x,y calculation in the loop.  The loop iteration variable <code>i</code> is really <code>t</code> in your motion equations.  Each time you calculate a new x,y you simply move the turtle to that position:</p>

<pre><code>import turtle
from math import pi, atan

x0, y0 = -180, -100  # initial location

vx, vy = 20.0, 88.0  # initial velocity in units per second

travel_time = 16  # seconds

g = 11.0  # acceleration due to gravity in units per second squared

turtellini = turtle.Turtle(shape='turtle', visible=False)

turtellini.penup()
turtellini.radians()  # to make turtle compatible with math.atan()
turtellini.setheading(pi / 2)  # straight up
turtellini.goto(x0, y0)
turtellini.pendown()
turtellini.showturtle()
turtellini.stamp()

for t in range(1, travel_time + 1):

    x = x0 + vx * t
    y = y0 + vy * t - g / 2 * t**2

    turtellini.goto(x, y)

    print(x, y)

    angle = atan((vy * t - g * t**2) / (vx * t))  # a guess!
    turtellini.setheading(angle)

    turtellini.stamp()

turtle.exitonclick()
</code></pre>

<p>Unlike the gold standard image, I assumed the turtle was aerodynamic like a bullet and travelled head first through the flight.  I don't know, and couldn't quickly find, the formula for the flight angle of a projectile so I guessed from the existing formulas:</p>

<p><a href="http://i.stack.imgur.com/jsnrY.png" rel="nofollow"><img src="http://i.stack.imgur.com/jsnrY.png" alt="enter image description here"></a></p>

python turtle-graphics