Free lab Real Python 3. Zero installs. Your code stays in this browser. Open the playground

Group Anagrams

Hard · 75 XP

Group words that are anagrams of each other. Print one line per group: the sorted words joined by spaces, groups ordered by first appearance.

Target output
ate eat tea
nat tan
bat
Blank · autosaved
PYgroup-anagrams.py
Run your code to check it…
Your next ten minutes

Write Python that does something useful.

Start free. No install, no card, no passive video marathon.

Start learning free → Explore the path