Python Functions and List Operations

Official
PythonBeginner
Overview

Practice basic function definitions and list comprehensions in Python.

Rules
Mode
All LinesNormalOff
Time Limit
No time limit
Mistake Limit
Unlimited
Code PreviewPython
def calculate_average(numbers: list[int]) -> float:
    if not numbers:
        return 0.0
    return sum(numbers) / len(numbers)

data = [10, 20, 30, 40, 50]
result = calculate_average(data)

squared = [x ** 2 for x in data if x > 20]
print(f"Average: {result}, Squared: {squared}")
Statistics
Mode
All LinesNormalOff
Time Limit
No time limit
Mistake Limit
Unlimited
Created
January 20, 2026
Challengers
3
Total Attempts
6
Completions
0
Avg WPM
41.33
Avg Accuracy
94.67%
Ranking
RankUserWPMAccuracy
4396.0%
4194.0%

Exercise Ranking

Top typers for this exercise

Total Participants

2

Period

All Time

Total Challenges (All Users)

3

Total Practice Time (All Users)

00:03:52

Total Keystrokes (All Users)

846

Period
Sort
RankUserwpmAccuracyStarted/CompletedCorrect/StrokesTotal TimeLast Attempt
43.0096.00%2/2534/56200:02:341/27/2026, 07:26 AM
41.0094.00%1/1267/28400:01:181/25/2026, 01:42 PM
Ranking of 2 users