Practice Arena

Python Coding Challenges

Write real Python in the browser. Instant feedback. From beginner to expert.

467 challenges 330 easy 120 medium 17 hard
Advanced Python medium

Retry decorator

Implement @retry(times=3) that retries a function on exception.

decorators error-handling
+28 pts 25m
Decorators & Context Managers easy

Context Manager Class

Implement a context manager class that measures execution time and sets duration, with None if an exception occurred.

context-manager classes timing
+8 pts 12m
Error Handling & Exceptions easy

Safe Integer from String

Implement safe_int that converts a string to an integer, returning a default value on any failure, with support for an optional base.

exceptions parsing default-value
+10 pts 15m
Error Handling & Exceptions easy

Safe int parser

Implement safe_parse_int that converts a string to an int, returning a default value on failure.

exceptions parsing validation
+10 pts 10m
Error Handling & Exceptions easy

Safe Float Parser

Write a function that safely converts a string to a float, returning None for invalid inputs.

float exception parsing
+10 pts 10m
Error Handling & Exceptions easy

Divide with zero check

Write a function that safely divides two numbers, catching division by zero.

exceptions division error-handling
+8 pts 10m
Error Handling & Exceptions easy

Key error handler

Implement a safe dictionary access function that returns a default value on missing keys.

exceptions dict fallback
+8 pts 10m
Error Handling & Exceptions easy

Else on try block

Implement a function that uses try-except-else to safely divide two numbers and return a result or error description.

exception-handling try-except-else division
+8 pts 10m

Showing 8 challenges

Guide: free Python coding challenges

Practice Python by solving problems

PythonSkillset challenges are hands-on coding exercises from beginner to advanced. Open a challenge, read the problem, write Python in the split-pane editor, and run tests with Pyodide — no install required.

How to use the arena

  1. Pick a category — basics, algorithms, strings, and more
  2. Open a challenge, read the statement, and edit the starter code
  3. Run tests, fix failures, then try a related quiz or tutorial lesson

Challenges vs tutorials and quizzes

Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.