Practice Arena

Python Coding Challenges

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

925 challenges 556 easy 323 medium 46 hard
Strings & Text easy

Title case converter

Return the string with each word capitalised.

strings split
+5 pts 5m
Strings & Text easy

Longest word in a sentence

Write a function that returns the longest word from a sentence, with first-occurrence tie-breaking.

strings parsing split
+8 pts 10m
Strings & Text easy

Initials from a Full Name

Return the uppercase initials of each word in a given full name.

strings splitting uppercase
+8 pts 10m
Strings & Text easy

Count words in a sentence

Implement a function to count words in a sentence, ignoring extra whitespace and handling empty strings.

strings split counting
+10 pts 10m
Strings & Text easy

Reverse Words in a Sentence

Reverse the order of words in a sentence while preserving single spaces between words.

strings split reverse
+10 pts 15m
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

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
Strings & Text easy

Split on camelCase

Given a camelCase string, split it into words at uppercase letters and return them as lowercase words.

strings parsing camelcase
+8 pts 10m
Strings & Text easy

Normalize Whitespace

Write a function that normalizes any whitespace in a string to single spaces and trims the ends.

strings whitespace split-join
+5 pts 10m
Strings & Text easy

Parse URL components

Write parse_url that splits a URL into its standard components with defaults for missing parts.

url-parsing strings parsing
+8 pts 10m
Strings & Text easy

Parse numbered list

Take a string containing a numbered list and return a clean list of the item texts.

string parsing strip split
+8 pts 12m
Strings & Text easy

Compare Version Strings

Given two version strings, compare them numerically by splitting on dots and ignoring leading zeros.

strings parsing comparison
+10 pts 15m
Strings & Text easy

Parse path segments

Implement a function that parses a path string into clean segments, ignoring slashes, empty parts, and dot segments.

strings parsing split
+10 pts 10m
Strings & Text easy

Parse coordinate pairs

Parse a string of coordinate pairs into a list of coordinate lists.

parsing strings split
+8 pts 12m
Lists & Arrays easy

Chunk list into groups

Implement a function that splits a list into sublists of a given size.

list slicing chunking
+10 pts 10m
Data Structures & Algorithms easy

Memory view slice

Implement chunk_list that splits a list into consecutive sublists of a given chunk size.

slicing lists chunking
+10 pts 15m
Dynamic Programming hard

Split Array Largest Sum

Minimize the largest sum among k contiguous subarrays using dynamic programming.

dynamic-programming binary-search arrays
+45 pts 40m
Binary Search medium

Binary Search on Answer: Find the Minimal Maximum Subarray Sum

Implement a function that finds the minimal possible maximum subarray sum when splitting an array into at most k contiguous subarrays.

binary-search arrays greedy
+25 pts 25m
Binary Search medium

Minimum Limit of Balls in a Bag

Given an array of bag sizes and a number of allowed splits, find the minimum possible maximum bag size.

binary-search arrays optimization
+25 pts 25m
Linked Lists medium

Split list at index

Return prefix and suffix tuples at index k.

linked-list lists pointers
+22 pts 20m

Showing 1–20 of 20 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.