Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # b_barchart.py
- ch=chr(219)
- def col(sz):
- mn,mx=min(sz),max(sz)
- df = (mx-mn)//8
- bkt = [(el-mn)//df for el in sz]
- hrz = [b+c for b,c in [(ch*(el+1)," "*(8-el)) for el in bkt]]
- return "\n".join([" ".join(el) for el in list(map(list, zip(*hrz)))[::-1]])
- import random
- for z in 'zz':
- print
- series = [random.randint(10, 99) for _ in range(25)]
- print(col(series))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement