Python Functions and List Operations

Easy
PythonBeginner
Overview

Practice basic function definitions and list comprehensions in Python.

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
Time Limit
No time limit
Created
January 20, 2026
Challengers
2
Completions
0
Avg Accuracy
95.0%
Avg WPM
42
Ranking
RankUserWPMAccuracy
Ssupermandesu
4396.0%
Sslime_
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
Ssupermandesu
43.0096.00%2/2534/56200:02:341/27/2026, 04:26 PM
Sslime_
41.0094.00%1/1267/28400:01:181/25/2026, 10:42 PM
Ranking of 2 users