Answer the question
In order to leave comments, you need to log in
Task from Yandex.Practice (Python-worker). How to insert a link into an HTML tag?
The line needs to be edited: insert the
icecreams += f"{icecream_db[i]['name']}
" HTML link tag into it
In a loop that loops through the icecream_db list and retrieves the ice cream names from it, insert an opening HTML tag with the attribute href="element_index/" before the variety name, and an end
tag after the name. The element index is stored in the iteration counter of the loop (in the i variable). Note that the link in the view function should be href="item_index/",
Answer the question
In order to leave comments, you need to log in
Be clearer next time, but you probably want something like this:
icecreams += f'<a href="{i}/">{ icecream_db[i]["name"] }</a>'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question