Skip to main content
← CoursesPython FoundationsМодуль 9 · Бонус: міні-проєктиMINI: Log parser — top 3 IPs by error countmission167 / 170
💬 Discuss🧪 Playground+200 XP
Task
Implement `top_error_ips(lines, n=3)` for nginx-style log lines. Run on the prepared sample (status mix including 5xx). Print the result as a list of (ip, count) tuples. Expected: [('10.0.0.5', 3), ('10.0.0.7', 2), ('10.0.0.1', 1)]

Keep going

✏️ Write your code here
🐍
Loading Python...
First visit only — ~5-10s. Stays cached afterward.
📊 Result
Press Run to see result...
📣 Help someone learn PythonShare this lesson with a friend — the first 15 are free, no signup.Tweet

💬 Discussion

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