Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. y=1000000
  2. for x in range(y):
  3. if x % 100000 == 0 and x!=0 or x==y :
  4. print " Iteration %d out of %dr" % (x,y)
  5.  
  6. Iteration 100000 out of 1000000
  7. Iteration 200000 out of 1000000
  8. Iteration 300000 out of 1000000
  9. Iteration 400000 out of 1000000
  10. Iteration 500000 out of 1000000
  11. ...
  12.  
  13. for x in range(1000000):
  14. print "%dr" % x,
  15.  
  16. print s ,
  17.  
  18. print " Iteration %d out of %dr" % (x,y) ,
  19.  
  20. print x, # 2.x: Trailing comma suppresses newline
  21. print(x, end="") # 3.x: Appends a space instead of a newline
  22.  
  23. sys.stdout.write(" Iteration %d out of %dr" % (x,y))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement