Posted By

brm on 01/03/16


Tagged

test


Versions (?)

Number histogram 2


 / Published in: Python
 

Print number histogram 2

  1. #!/usr/bin/python
  2.  
  3. def func(a, b):
  4. la = a
  5. lb = b
  6. while la <= lb:
  7. for i in range(a, b+1):
  8. if (la <= i) and (i <= lb):
  9. print i,
  10. else:
  11. print " ",
  12. print
  13. la += 1
  14. lb -=1
  15. #print func(1,5)

Report this snippet  

You need to login to post a comment.