validate_registration(username, age, email) that returns the first applicable error message using guard clauses, or "OK" if everything is valid. Rules, checked in order: if len(username) < 3, return "Username too short". If age < 13, return "Too young to register". If "@" not in email, return "Invalid email". Otherwise return "OK".validate_registration("ab", 20, "a@b.com")"Username too short"
Username fails the first guard clause.
validate_registration("alice", 10, "a@b.com")"Too young to register"
Username passes; age fails.
validate_registration("alice", 20, "no-at-sign")"Invalid email"
Only the email check fails.
validate_registration("alice", 20, "a@b.com")"OK"
All checks pass.
Return early from each guard clause instead of nesting deeper.
The order of the checks matters: earlier failures should short-circuit the rest.