Skip to content
C

Problem 4: Histogram of Age Distribution

Easypython

Problem Description

Write a Python program that creates a histogram showing the distribution of ages from a list of at least 10 values, using 4 bins.

Input

A list of at least 10 ages.

Output

A displayed histogram with 4 bins showing the frequency of ages in each range.

Constraints

  • Ages must be positive integers.

Example Input

text
ages = [18, 22, 25, 30, 19, 21, 28, 35, 40, 33]

Example Output

text
(A histogram window showing age distribution grouped into 4 bins)

Concepts Covered

plt.hist(), bins, titles, axis labels.

Input (stdin)

Output

Run your code to see output here...