Sunday, August 9, 2020

Draw Line

https://slideplayer.com/slide/3268443/

https://stackoverflow.com/questions/59818617/why-is-turtle-not-drawing-in-python-3-in-line-class


https://code.sololearn.com/ctB1aNUv0aIz/#py


import turtle
turtle.setup(500,500) # Config turtle settings
turtle.setworldcoordinates(-250,-250,250,250) # Config turtle settings
critter = turtle.Turtle()
def draw_line(t, x1, y1, x2, y2):
    t.penup()
    t.goto(x1, y1)
    t.pendown()
    t.goto(x2, y2)
draw_line(critter, -100, -100, 100, 100)
draw_line(critter, -100, 100, 100, -100)

No comments:

Post a Comment

Python Files and Exceptions: Unit 9

  Table of contents Reading from a File Reading an Entire File File Paths Reading Line by Line Making a List of Lines from a File Working wi...