We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Draw Lines

Time to actually draw something useful on the screen!

Assignment

  • x - the x-coordinate (horizontal) in pixels of the point
  • y - the y-coordinate (vertical) in pixels of the point

The value x=0.0 is the left of the screen, y=0.0 is the top of the screen.

    • It should call the Canvas's create_line method:
canvas.create_line(x1, y1, x2, y2, fill=fill_color, width=2)
  1. Draw a few lines on the window using your new methods in your main function, then test the program manually.