4.2.10 Summary Functions: len(), sum(), min(), max()

Unit: Unit 4: Strings, Lists, and Tuples • Interactive Practice

Quick Answer & Summary:

Interactive Python programming tutorial and practice in your browser.

Interactive Challenge (Run Live in Browser):

# Calculate summary statistics on daily active users
daily_users = [1200, 1450, 1320, 1600, 1550]

# 1. Total days recorded
count = len(daily_users)

# 2. Total cumulative users
total_users = sum(daily_users)

# 3. Peak and lowest recorded days
peak_day = max(daily_users)
slowest_day = min(daily_users)

# 4. Average users per day
average_users = total_users / count

print(f"Days: {count} | Total: {total_users}")
print(f"Peak: {peak_day} | Lowest: {slowest_day}")
print(f"Average: {average_users:.1f}")
Open in Live Interactive Python Sandbox →