#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    Helpp Pyhthon Idle Troubles


    is this code right? or not? if so can you fix it ? from turtle import *

    def move_turtle():
    # Pick up the turtle and move it to its starting location.
    penup()
    goto(-200, 100)
    pendown()

    def draw_H():
    # Draw the left leg of the H.
    # The turtle starts at the bottom left of the letter, pointing right.
    left(90)
    forward(100)
    # Draw the bar of H.
    # The turtle starts at the top of the left leg, pointing up.
    forward(-50)
    right(90)
    forward(50)
    # Draw the right leg of the H.
    # The turtle starts on the right side of the bar, pointing right.
    left(90)
    forward(50)
    forward(-100)
    right(90)
    # The H is drawn.
    # The turtle is at the bottom right, pointing right.

    def draw_space():

    def draw_E():
    # Draw an E.
    left(90)
    forward(100)
    right(90)
    forward(50)
    forward(-50)
    right(90)
    forward(50)
    left(90)
    forward(50)
    forward(-50)
    right(90)
    forward(50)
    left(90)
    forward(50)

    def draw_L():
    # Draw an L.
    left(90)
    forward(100)
    forward(-100)
    right(90)
    forward(50)

    def draw_O():
    # Draw an O.
    forward(50)
    left(90)
    forward(100)
    left(90)
    forward(50)
    left(90)
    forward(100)
    left(90)
    forward(50)

    move_turtle()

    draw_H()
    draw_space()
    draw_E()
    draw_space()
    draw_L()
    draw_space()
    draw_L()
    draw_space()
    draw_O()
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480
    Your program would be "right" if you'd bother to finish defining the space. i used

    def draw_space(): pass
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo