Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created June 27, 2018 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/8d421b41e8238b1162798ace1725f894 to your computer and use it in GitHub Desktop.
Save Fhernd/8d421b41e8238b1162798ace1725f894 to your computer and use it in GitHub Desktop.
Iterar de forma ordenada todos los elementos de dos listas. OrtizOL.
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