Web Development and Design | Tutorial for Java, PHP, HTML, Javascript: python-2.7-statistics

Web Development and Design | Tutorial for Java, PHP, HTML, Javascript: python-2.7-statistics
Showing posts with label python-2.7-statistics. Show all posts
Showing posts with label python-2.7-statistics. Show all posts

Python Simple Statistics

Python Simple Statistics

Simple statistics

There are a number of simple statistics you can run on a list containing numerical data.

#Finding the minimum value in a list
ages = [93, 99, 66, 17, 85, 1, 35, 82, 2, 77]
youngest = min(ages)
#Finding the maximum value
ages = [93, 99, 66, 17, 85, 1, 35, 82, 2, 77]
oldest = max(ages)
#Finding the sum of all values
ages = [93, 99, 66, 17, 85, 1, 35, 82, 2, 77]
total_years = sum(ages)
print(total_years)

Screenshot