Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
April 11th, 2013, 03:42 PM
 bemo
Registered User

Join Date: Apr 2013
Posts: 1
Time spent in forums: 10 m 42 sec
Reputation 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
April 11th, 2013, 05:34 PM
 b49P23TIvg
Contributing User

Join Date: Aug 2011
Posts: 4,218
Time spent in forums: 1 Month 3 Weeks 2 Days 18 h 51 m 46 sec
Reputation Power: 455
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!

 Viewing: Dev Shed Forums > Programming Languages > Python Programming > Helpp Pyhthon Idle Troubles