Latest web development tutorials

Python incluye ejercicios 93

Python 100 Li Python 100 Li

Título: 3 en función del tiempo, por ejemplo.

Análisis del programa: Ninguno.

Código fuente:

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

if __name__ == '__main__':
    import time
    start = time.clock()
    for i in range(10000):
        print i
    end = time.clock()
    print 'different is %6.3f' % (end - start)

La salida del ejemplo anterior es:

0
1
2
3
4
……
different is  0.014

Python 100 Li Python 100 Li