Reputation: 31
Although the response is same as request i am sending to save about us. But didn't know how to render on webpage correctly.
{
"fullName": "Chandan nick",
"totalProducts": 4,
"totalReviews": 0,
"aboutus": "<ol>\n<li>Hi</li>\n<li>This </li>\n<li>is </li>\n<li>about </li>\n<li>us</li>\n</ol>",
"minMonthProd": null,
"maxMonthProd": null,
"tagLine": " "
}
I am confused , how this is happening. Please help me out.
Upvotes: 0
Views: 38
Reputation: 1
response_str = "Here are the steps:\nStep 1: Do this.\nStep 2: Do that.\nStep 3: Do the other thing."
response_list = response_str.split('\n')
response_list.pop(0)
for I in range(len(response_list)):
response_list[i] = f"{i+1}. {response_list[i]}"
ordered_list_str = '\n'.join(response_list)
print(ordered_list_str)
Upvotes: 0