Creating a histogram from a list of values. : Length : List PYTHON TUTORIALS


PYTHON TUTORIALS » List » Length »

 

Creating a histogram from a list of values.


values = []   # a list of values

print "Enter 10 integers:"

for i in range10 ):
   newValue = intraw_input"Enter integer %d: " i + ) ) )
   values += newValue ]

print "nCreating a histogram from values:"
print "%s %10s %10s" "Element""Value""Histogram" )

for i in rangelenvalues ) ):
   print "%7d %10d  %s" i, values]"*" * values] )



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo List
» Length