jeudi 4 mai 2017

accessing item in a python loop with conditions

say i have a list of dictionaries like this:

data = [
{'views' : views,
 'ratings' : ratings,
 'link' : link
},
{'views' : views,
 'ratings' : ratings,
 'link' : link
},
{'views' : views,
 'ratings' : ratings,
 'link' : link
},
{'views' : views,
 'ratings' : ratings,
 'link' : link
},
...
...
]

how do I get the link of item that has views greater than 500000 AND ratings greater than 80?

Aucun commentaire:

Enregistrer un commentaire