Whats is wrong with my code?

Use print_llm_response() to print a poem with the specified number of lines. Use the

prompt variable to save your prompt before calling print_llm_response()

Here is my code:

number_of_lines = input (“mentioned the number of lines in poem is “)
prompt = f””" Write a poem with the specified number of lines {number_of_lines} about mother nature"“”
print_llm_response(“poem”)

Whats is wrong with my code?

I am getting answer

mentioned the number of lines in poem is 7
Roses are red,
Violets are blue,
I’m here to help,
What can I do for you?

Check what you’re passing to print_llm_response(), which is why the function is not using your intended prompt. You should be passing prompt as the argument instead of poem. Also, check the quotes to avoid syntax errors.

PS: Posting solution code in a public topic is against our Community Forum Code of Conduct (Code of Conduct - DeepLearning.AI). It’s okay to share stacktrace in a public post and to send code to a mentor via direct message if they ask for it.

Please edit your post.