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
Python Basics easy

Seconds to Hours Minutes Seconds

Convert total seconds into a zero-padded HH:MM:SS format.

arithmetic divmod formatting
+8 pts 10m
Python Basics easy

Hello, name!

Implement a function that returns a personalized greeting for a given name.

strings function formatting
+5 pts 5m
Python Basics easy

Minutes to Hours: Time Conversion Helper

Write a function that converts minutes into a human-readable 'Xh Ym' string, with special cases for zero and whole hours.

arithmetic formatting conditionals
+8 pts 10m
Strings & Text easy

Center a string in a width

Write a function that centers a string within a specified width by adding spaces on both sides.

strings padding formatting
+8 pts 10m
Strings & Text easy

Abbreviate Name

Create a function that takes a full name and returns an abbreviated version with initials and the last name.

strings formatting split
+10 pts 15m
Strings & Text easy

Snake case converter

Implement a function that converts a string to snake_case according to given rules.

strings snake_case formatting
+10 pts 15m
Strings & Text easy

Error message formatter

Write a function that constructs a formatted error message from a code, an optional context, and a fallback message.

formatting strings function
+10 pts 15m
Strings & Text easy

Parse Log Line

Write a function that parses a log line and returns a dictionary with timestamp, level, and message.

string-parsing split strip
+10 pts 15m
OOP & Classes medium

Complex Number Class

Implement a Complex class supporting addition, subtraction, multiplication, division, equality, and string formatting.

classes magic-methods arithmetic
+20 pts 25m
Regular Expressions medium

Match Credit Card Pattern

Write a function that validates a credit card number string against a set of formatting rules.

regex validation credit-card
+25 pts 25m

Showing 10 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.