Pular para o conteúdo principal

Questão de Programação — Python — INSTITUTO AOCP 2020

ProgramaçãoPython
Código
qq604469
Banca
INSTITUTO AOCP
Órgão
MJSP
Ano
2020
Nível
Superior
In Python, the statement 'for loop' is used for iterating over a sequence. Considering that, choose the correct alternative that presents a proper example concerning the use of 'for loop' in Python.
  1. Afor x = ["John", "Sophie", "Junior"]:print(x)
  2. Barray (["John"],["Sophie"],["Junior"])for each i = 0 to array[i] print (array[i])
  3. Cnames = ["John", "Sophie", "Junior"]for x in names: print(x)
  4. Dnames = {{"John"}, {"Sophie"}, {"Junior"}} for x in names: print(names)
  5. Earray.names("John", "Sophie", "Junior")for x print(names[x]): end for:
Revelar gabarito e comentário

GabaritoC — names = ["John", "Sophie", "Junior"] for x in names: print(x)

Link permanente: /questoes/qq604469