Learn Before
Crafting a Python Code Generation Prompt
You need a Python function that identifies palindromes in a list of strings. The function should accept a list of strings as input and return a new list containing only those strings that read the same forwards and backward (e.g., 'racecar', 'madam'). Write a clear and effective natural language instruction for a code-generating tool to create this specific function.
0
1
Tags
Ch.3 Prompting - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Ch.2 Generative Models - Foundations of Large Language Models
Creation in Bloom's Taxonomy
Cognitive Psychology
Psychology
Social Science
Empirical Science
Science
Related
A developer needs a Python function to calculate the average of a list of numbers. A crucial requirement is that the function must return 0 if the input list is empty, instead of raising an error. The developer provides the following natural language instruction to a code-generating tool: 'Write a Python function to calculate the average of a list of numbers.' Which of the following statements best evaluates this instruction's quality for the intended purpose?
Refining a Prompt for Python Code Generation
Crafting a Python Code Generation Prompt
Example of a Prompt and Completion for a Python Average Function