Duda novato: for numeros decimales

Manuel Enrique Gutierrez Perez megutierrez en estudiantes.uci.cu
Dom Mar 8 21:14:46 CET 2009


puedes hacer un xrange tu mismo.


def xrange(start, stop=None, step=1):
    if stop is None:
        stop = start
        start = 0
    else:
        stop = int(stop)
    start = int(start)
    step = int(step)

    while start < stop:
        yield start
        start += step



--
Manuel E.



-----Original Message-----
From: Jesse [mailto:jpadillaa en gmail.com]
Sent: Sat 07.03.2009 20:42
To: Lista de discusión sobre python en castellano
Subject: [Python-es] Duda novato: for numeros decimales
 
Hola Lista,

Cordialmente pregunto como hago un ciclo for usando numeros decimales
dado que usar range(x,y,p) solo me permite usar numeros enteros, ejemplo

for i in range(1,10,2)
 print i

me gustaria saber si hay una funcion o metodo no se que me permita
hacer esto:

for i in funcion(0.1,1.,0.1)
 print i


de antemano gracias


------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2915 bytes
Desc: no disponible
URL: <http://mail.python.org/pipermail/python-es/attachments/20090308/4be13db6/attachment.bin>
------------ próxima parte ------------
_______________________________________________
Lista de correo Python-es 
http://listas.aditel.org/listinfo/python-es
FAQ: http://listas.aditel.org/faqpyes


Más información sobre la lista de distribución Python-es