I1m trying to set the last route /‘animals/pet_type/pet_id’ but i don1t know how to insert the value stored in the for loop in the href tag. can anyone help?,
@app.route(’/animals/string:pet_type’)
def animals(pet_type):
html = f’’’
List of {pet_type}
‘’’html += ‘
- ’
for idx, i in enumerate(pets[pet_type]):
name = i['name'];
html += f"<li> <a href = '{{/animals/pet_type/idx}}'> {name} </a> </li>"
html += ‘
’return html