python intermediate 2026-11-17 को समाप्त

Parse a log file

Given lines from a web server access log, write summarise(lines) that returns a dict with:

  • "requests": number of valid lines
  • "errors": number of responses with status 500 or above
  • "top_path": the most requested path (ties: alphabetically first)
  • "bad_lines": number of lines that don't match the format

Line format: IP - - [time] "METHOD /path HTTP/1.1" STATUS BYTES

अब तक 0 लोगों ने हल किया।

python
एडिटरCtrl + Enter

            
        

जब टेस्ट "All tests passed" दिखाते हैं, तो चैलेंज इस ब्राउज़र में हल के रूप में चिह्नित हो जाता है।

अपना समाधान समीक्षा के लिए भेजें