Learn Before
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?
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
Evaluation 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