Learn Before
A developer provides a language model with the following Python code and comment, asking it to complete the function:
def find_even_numbers(num_list): # return a new list containing only the even numbers from num_list
Below are four different outputs the model could generate. Match each output to the most accurate description of its quality or potential issue.
0
1
Tags
Ch.3 Prompting - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Analysis in Bloom's Taxonomy
Cognitive Psychology
Psychology
Social Science
Empirical Science
Science
Related
Example of a Prompt for Sequence Completion
Examples of Prompts for Python Code Generation
A developer has started writing a Python function but needs help finishing the implementation. They have the following code:
def calculate_factorial(n): """Calculates the factorial of a non-negative integer n.""" # Implementation needed hereThey want to use a language model to generate the rest of the function's code. Which of the following prompts is most likely to yield a correct, efficient, and contextually appropriate code completion?
Critiquing an AI-Generated Code Snippet
A developer provides a language model with the following Python code and comment, asking it to complete the function:
def find_even_numbers(num_list): # return a new list containing only the even numbers from num_listBelow are four different outputs the model could generate. Match each output to the most accurate description of its quality or potential issue.