Created
May 10, 2022 19:06
-
-
Save jonathasborges1/b535b004bc670791017b571a4337d052 to your computer and use it in GitHub Desktop.
Lista de Ordenação - Questão de Prova - Analista de Tecnologia da informação da fazenda
This file contains hidden or 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
// Assinale o codigo a seguir em linguagem de programação Python. | |
// Indique a saída correta do programa. | |
def rotina(array): | |
for p in range(0,len(array)): | |
element = array[p] | |
while p > 0 and array[p-1] > element: | |
array[p] = array[p-1] | |
p -= 1 | |
array [p] = element | |
return array | |
print(rotina([9,5,31,42,20,56])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment