Log inBook a Demo
BuildJuniorBackendAuto-graded

Fix signup validators that accept the wrong inputs

Five signup validators get real input wrong: stray spaces, plus-addressed emails, international phone numbers, leap days.validators.py has five validators for a signup form (email, phone, password, username, date). Each takes one value and returns True or False. In production they turn away valid input such as an international phone number, let through input they should refuse such as 2023-02-29, and fail on None. Make each one match the spec in the brief, keeping the same signature. A validator only counts if it gets every case in a hidden test set right.
30 min
python

What it measures

PythonHandling messy and missing values with the standard library, without raising.
Test case designThinking of the inputs a real form sends: boundary lengths, odd formats, empty fields.
Balanced judgementAccepting the valid input users really type while still rejecting what the spec forbids.

Your environment

Terminal + editorA full shell in the browser
Coding agentAlready signed in, no API key to set up
Isolated workspaceOnly yours, wiped when you finish

Start this lab

30 min
Start labYou'll need to sign in to Anthropos first. The lab opens in a private cloud workspace with your coding agent ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo