Number histogram 2


/ Published in: Python
Save to your folder(s)

Print number histogram 2


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.