Python Function from Natural-Language Specification

Anthropic prompt library

Submit a prompt

Overview

Implement a Python function from a natural-language specification with validation, edge-case handling, and comments.

Use cases

Prompt
Copied 0
Create a Python function based on the natural language request. The request describes desired functionality, input parameters, and expected return value. Implement according to the specifications: handle edge cases, perform validations, follow Python best practices, and include comments explaining the logic.

REQUEST:
<<<paste NL function spec>>>

Can AI?

Alternatives

  • Production Class or ModuleGenerate a production-ready class or module with validation, clear interfaces, and clean API design.Coding agent
  • Write unit tests for a chosen function with a Copilot prompt fileA prompt file from GitHub's Copilot customization library that studies the function or method you have selected and writes focused unit tests. It covers normal behaviour, invalid and boundary inputs, error handling and side effects, asking which function and test framework to use and aiming for 5 to 8 independent tests.Coding agent
  • Generate an OpenAPI 3.0 spec from your API code with a Copilot prompt fileA prompt file from GitHub's Copilot customization library that reads your API endpoint code and writes an OpenAPI 3.0.3 specification in YAML. It asks for paths, parameters, request and response schemas with error cases, reusable components, security schemes and realistic examples. To use it, save the file in your repository's .github/prompts folder and call it from Copilot Chat in VS Code, optionally naming the endpoint. Prompt files are a preview feature in VS Code.Coding agent

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall