Create a Python program to read numbers from stdin and produce a histogram, showing the frequency of the numbers in each 10 buckets.
15
-7
-3
29
4
import sys

# Define buckets
buckets = [0]*10

# Read line-by-line
for line in sys.stdin:
 # Read as integer
 value = int(line)

 # Find the bucket
 bucket = max(int(value/10), 0)
 buckets[bucket] += 1

# Output result
for i, count in enumerate(buckets):
 print('{}-{}: {}'.format(i*10, i*10+9, count))