← Noviq Academy
Cybersecurity · Beginner · Free
Python for Cybersecurity: Learn by Doing
Real Python in your browser: parse logs, validate IPs, call APIs safely and build a failed-login detector.
Skill 4 of Noviq's five-skill cybersecurity series. Every exercise runs real Python in your browser and is checked instantly against synthetic security data. Learn the data structures behind security scripts, parse CSV exports safely, extract and validate IP addresses, count failed logins, query an API without crashing, and write reports, then build a failed-login detector with a sliding time window and tests. Ends with troubleshooting, flashcards and a timed exam.
- 9 lessons
- About 230 minutes
- 5 runnable code cells
- 11 auto-checked exercises
- 1 timed practice exams
- 12 flashcards
- 32 quiz questions
No sign-up needed. Your progress is saved on this device.
Course outline
0 of 9 lessons complete
Module 1 · Python Foundations for Security Data
- 1Python for defenders: lists, dicts, sets and tuplesThe four data structures behind almost every security script, practised on IP addresses and login events.22 min
- 2Parse CSV the safe wayRead a login export with csv.DictReader, validate every row, and count valid and rejected records separately.22 min
- 3Extract and validate IP addressesFind candidate addresses in messy log text with re, then confirm each one with the ipaddress module.20 min
- 4Count failed logins with CounterGroup failures by (user, source IP) after normalising the input, and see why a total isn't a detector yet.20 min
Module 2 · APIs, Reports and the Detector Project
- 5Query an API without falling overRead JSON from a local mock API with a timeout, and handle connection errors, bad status codes and invalid JSON separately.22 min
- 6Write a report you can read backTurn the failure counts into deterministic JSON with the input name and processing summary, then load it again to prove it works.18 min
- 7Guided project: build a failed-login detectorValidate timestamps, group failures, slide a five-minute window with a deque, alert once per burst, and test the edge cases.50 min
Module 3 · Troubleshoot and Review
- 8Diagnose before you changeFix a crash on a malformed row, a wrong time window and a time-zone mix-up, and tell duplicate events from duplicate alerts.25 min
- 9Cheat sheet, flashcards and final examStructures, files, exceptions and modules on cards, then a timed exam and your readiness checkpoint.30 min