Latest web development tutorials

Python incluye ejercicios 56

Python 100 Li Python 100 Li

Título: dibujo, escuela de pintura con la ronda círculo.

Análisis del programa: Ninguno.

Código fuente:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

if __name__ == '__main__':
    from Tkinter import *

    canvas = Canvas(width=800, height=600, bg='yellow')  
    canvas.pack(expand=YES, fill=BOTH)                
    k = 1
    j = 1
    for i in range(0,26):
        canvas.create_oval(310 - k,250 - k,310 + k,250 + k, width=1)
        k += j
        j += 0.3

    mainloop()

La salida del ejemplo anterior es:

Python 100 Li Python 100 Li