Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to format the instruction string with the model name.
Prompt Engineering / GenAI
instruction = f"Use the [1] model for text generation."
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name instead of the actual model name string.
Leaving the placeholder empty.
✗ Incorrect
The placeholder should be replaced with the model name, e.g., 'GPT-4', to complete the instruction.
2fill in blank
mediumComplete the code to insert the temperature value into the instruction string.
Prompt Engineering / GenAI
instruction = f"Set temperature to [1] for creative responses."
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names instead of actual numeric values.
Using values outside the 0 to 1 range.
✗ Incorrect
The temperature value should be a number like 0.7 to control creativity in generation.
3fill in blank
hardFix the error in the instruction formatting to include max tokens.
Prompt Engineering / GenAI
instruction = f"Generate text with max tokens [1]."
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase instead of snake_case.
Adding extra suffixes to the variable name.
✗ Incorrect
The correct variable name is 'max_tokens' to specify the token limit.
4fill in blank
hardFill both blanks to create an instruction that sets model and temperature.
Prompt Engineering / GenAI
instruction = f"Use [1] with temperature [2] for generation."
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using an unrelated model name.
Choosing temperature values outside the typical range.
✗ Incorrect
The model name 'GPT-4' and temperature '0.7' correctly complete the instruction.
5fill in blank
hardFill all three blanks to format an instruction with model, temperature, and max tokens.
Prompt Engineering / GenAI
instruction = f"Model: [1], Temp: [2], Max tokens: [3]."
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of values.
Using non-numeric values for temperature or max tokens.
✗ Incorrect
The instruction uses model 'GPT-3.5', temperature '0.8', and max tokens '150'.