Created
June 19, 2018 21:02
-
-
Save reflechant/3b3aad80980bb19c8d666d708ed85b9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
mylist = [randint(10,20) for x in range(randint(10,15))] | |
print(*mylist) | |
even = [x for x in enumerate(mylist) if x[1] % 2 == 0] | |
for i in zip((x[0] for x in even), sorted(x[1] for x in even)): | |
mylist[i[0]] = i[1] | |
print(*mylist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment