vendredi 21 mai 2021

How to read this list comprehension

I need a little help with understanding, or like how to read these kind of comprehension

[word[1:-1:2] for word in ['Norway', 'Sweden', 'Denmark'] if 'r' in word]

h = [2*x for x in range(10) if divmod(x, 2)[1] == 0]

thanks in advance

Aucun commentaire:

Enregistrer un commentaire