W
W
whyyy2020-08-23 11:24:52
Python
whyyy, 2020-08-23 11:24:52

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/",


I'm trying to paste in different places, but it doesn't work. Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mark Chigrin, 2020-08-23
@whyyy

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 question

Ask a Question

731 491 924 answers to any question