mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 06:46:17 +00:00
Upd of print func to py3 syntax
This commit is contained in:
@@ -176,17 +176,17 @@ What's the difference in speed? Let's try it!
|
|||||||
#primes implemented with Python
|
#primes implemented with Python
|
||||||
import primes
|
import primes
|
||||||
|
|
||||||
print "Cython:"
|
print("Cython:")
|
||||||
t1= time.time()
|
t1= time.time()
|
||||||
print primesCy.primes(500)
|
print(primesCy.primes(500))
|
||||||
t2= time.time()
|
t2= time.time()
|
||||||
print "Cython time: %s" %(t2-t1)
|
print("Cython time: %s" %(t2-t1))
|
||||||
print ""
|
print("")
|
||||||
print "Python"
|
print("Python")
|
||||||
t1= time.time()
|
t1= time.time()
|
||||||
print primes.primes(500)
|
print(primes.primes(500))
|
||||||
t2= time.time()
|
t2= time.time()
|
||||||
print "Python time: %s" %(t2-t1)
|
print("Python time: %s" %(t2-t1))
|
||||||
|
|
||||||
|
|
||||||
These lines both need a remark:
|
These lines both need a remark:
|
||||||
|
|||||||
Reference in New Issue
Block a user