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

Last Occurrence of a Value

Implement a function that returns the last index of a given value in a list, or -1 if it's not present.

lists search indexing
+10 pts 15m
Python Basics easy

Cycle a List Once

Implement a function that rotates a list right by one position.

lists rotation indexing
+5 pts 5m
Strings & Text easy

Find all indexes of a substring

Write a function that returns a list of all starting indexes where a substring appears in a string, including overlapping occurrences.

substring string searching
+10 pts 15m
Strings & Text easy

Interleave Two Strings

Given two strings s1 and s2, return a new string that interleaves them character by character, starting with s1.

strings merging loops
+8 pts 10m
Strings & Text easy

Find substring index

Implement a function that returns the starting index of the first occurrence of a substring using only basic string indexing and slicing.

string search index
+10 pts 15m
Lists & Arrays easy

Rotate Left by k

Implement a function that rotates a list left by k positions.

rotation lists slicing
+10 pts 15m
Lists & Arrays easy

Interleave Two Lists

Write a function that interleaves two lists element by element, preserving order.

lists merge indexing
+10 pts 10m
Lists & Arrays easy

Keep only even indexes

Given a list, return a new list containing only the elements at even indices (0, 2, 4, ...).

list slicing indexing
+5 pts 5m
Lists & Arrays easy

Middle Element of an Odd-Length List

Implement a function that returns the middle element of an odd-length list.

lists indexing basic
+5 pts 5m
Lists & Arrays easy

Last occurrence index

Implement a function that returns the last index of a given value in a list, or -1 if the value is not present.

lists indexing search
+10 pts 10m
Dicts & Sets easy

Word to Index Map

Create a function that returns a dictionary mapping each unique word to the index of its first occurrence.

dictionary mapping indexing
+10 pts 10m

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