Created
June 27, 2018 12:48
-
-
Save Fhernd/8d421b41e8238b1162798ace1725f894 to your computer and use it in GitHub Desktop.
Iterar de forma ordenada todos los elementos de dos listas. OrtizOL.
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
import heapq | |
pares = [2, 4, 6, 10, 18] | |
impares = [1, 3, 7, 9, 13, 17] | |
for elmt in heapq.merge(pares, impares): | |
print(elmt, end=' ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment