zip function practical application

One requirement is to paste two lists on the template with a for loop at the same time, and use zip to form a list of tuples at the back end, so that the template can use the .0.1 method, similar to x[0] x[1 in python ] display.

 

html shows:

 

 

 

The page actually shows:

 

In this way, the href of the a link is the value of the permission_list, and the displayed text is in the l list.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324864036&siteId=291194637