Skip to main content
πŸ”’ Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial β†’
⚑
← Coursesβ€ΊPython FoundationsModule 3 Β· Functions and stringsβ€ΊπŸŽ― Review Β· text stats with functionsscenario49 / 174
+50 XP
Task
Write `stats(text, words)` that returns a tuple of three ints: 1. `len(text)` β€” total chars including spaces 2. count of vowels (a, e, i, o, u β€” lowercase only) in `text` 3. length of the longest word in the `words` list β€” use `max()` with a `key=` lambda Then call `stats("hello world", ["hello", "world", "ok"])` and print each value on its own line. Expected output: ``` 11 3 5 ```
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
πŸ“Š Result
Press Run to see result...

πŸ’¬ Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…