Skip to content
ComputerCS
Start learning

Computer Science and Entrepreneurship · Practice

Programming challenge bank

219 Python coding challenges, retained alongside the full PECTAA curriculum. Filter the existing Python challenge bank by its mapped textbook unit, run visible and hidden tests, and keep your solved record and code drafts.

219 challenges6 difficulty tiers0 solved0 attempted0 XP earned

Loading saved progress…

Open full IDE

Python Programming · hard · 40 XP

Phone Number Formatter

2 tests

Read one raw line that is meant to be a Pakistani mobile number; it may mix digits with spaces or dashes. First strip everything that is not a digit. If what remains has exactly 11 digits and starts with 0, print it in international form `+92 XYZ PQRSTUVW` — drop the leading 0, then group the next 3 digits and the final 7 digits with single spaces (03001234567 becomes +92 300 1234567). Otherwise print `Invalid number`.

Python IDE

Python development workspace

Write, run, debug and manage Python projects directly in your browser.

Editor
python3 — ready
Terminal readyRun your Python file. Output, errors and input echoes will appear here.
Nerdlyy Agent · DisabledDisabled while you work through a lab or practice task so your attempt stays independent.

NERDLYY · FEEDBACK

Help shape Nerdlyy

Your feedback goes directly to the team. We read every submission.

No reply needed — you can send feedback without sharing contact details.