1. Learn
  2. /
  3. Courses
  4. /
  5. Prompt Engineering with the OpenAI API

Connected

Exercise

Analyze solution correctness

You're back from your relaxing vacation and you've been assigned the task of reviewing and correcting some programming tasks, including a function to calculate of the area of a shape. You are provided with a code string that contains the function to calculate the area of a rectangle, and need to assess its correctness. The ideal function for you is a function that has correct syntax, receives two inputs, and returns one output.

The OpenAI package and the get_response() function have been pre-loaded for you.

Instructions

100 XP
  • Create a multi-step prompt asking the model to assess the function provided in the delimited code string according to the three criteria: correct syntax, receiving two inputs, and returning one output.