#!/usr/bin/python3 # # This program reads a list of numbers from the standard input, with # one number per line, and prints a histogram corresponding to those # numbers. In this histogram, each number N is represented by a # line of N characters "#" # import sys if len(sys.argv) > 1: file = open(sys.argv[1], 'r') else: file = sys.stdin for line in file: for i in range(int(line)): sys.stdout.write('#') sys.stdout.write('\n')