Python Exercise Example57
# Python2.x Python Exercise Instance 57
[ Python 100 Examples](#)
**Title:** Drawing, learning to draw straight lines using line.
**Program Analysis:** None.
## Instance
```python
#!/usr/bin/python
# -*- coding: UTF-8 -*-
if __name__ == ' __main__ ':
from Tkinter import *
canvas = Canvas(width=300, height=300, bg='green')
canvas.pack(expand=YES, fill=BOTH)
x0 = 263 y0 = 263 y1 = 275 x1 = 275
for i in range(19):
canvas.create_line(x0,y0,x0,y1, width=1, fill='red')
x0 = x0 - 5
y0 = y0 - 5
x1 = x1 +
YouTip