Prompts for secure AI-assisted coding
You are now building web applications with sensitive financial data, and are using test-driven prompting to make sure your code to validate customer emails is robust. Instead of asking the model to code directly, you’ll define explicit tests and edge cases first so that model generates code that satisfies them.
Cet exercice fait partie du cours
AI-Assisted Coding for Developers
Instructions
- Write a prompt that tells the model to implement a Python function that validates email addresses that are in the format "[email protected]", rejects formats that do not contain the "@", and raises a ValueError for empty input.
Exercice interactif pratique
Passez de la théorie à la pratique avec l’un de nos exercices interactifs
Commencer l’exercice