- Executores
-
Aprender
Aprender Python Exemplos executáveis, NumPy, pandas e mais Aprender IA / Machine LearningRedes neurais, ML e LLMs do zero Aprender C e C++ Ponteiros, memória, STL e C++ moderno Aprender C#Fundamentos, POO, LINQ, async e exercícios .NET Aprender MatplotlibGráficos de linha, barras, dispersão e pizza com visualizadores Aprender RustOwnership, traits, tratamento de erros e threads Aprender GoSlices, interfaces, goroutines e channels Algoritmos em Python Busca, ordenação, recursão e visualizações O(n) Algoritmos em C e C++ Compare implementações em C e C++ Programação para crianças Aprenda a programar brincando!
- QuizzesNovo
- DesafiosNovo
- Para professoresNovo
- Atualizações
- Me pague um café
Quiz de Python: Output-Based Python Questions
Many Python interviews hand you a snippet and ask "what does this print?". This quiz is ten of those, each mixing two ideas such as rebinding vs mutation, slicing with steps, sort keys or exhausted generators.
Pergunta de exemplo
Pergunta 1 de 10What does this print?
a = [1]
b = a
a = a + [2]
c = [1]
d = c
c += [2]
print(b, d)
Mostrar a resposta
A. [1] [1, 2] a + [2] builds a new list and rebinds a, so b still points to the old [1]. c += [2] extends the list in place, and d is that same list, so it shows [1, 2].
O que este quiz cobre
a = a + [x]vsa += [x]- Slicing with steps and negative steps
- Dict comprehensions with repeated keys
- Sort keys that use tuples
- Generators that can only be used once
Perguntas frequentes
Preciso de uma conta?
Não. Qualquer pessoa pode jogar. Entre para guardar seu XP, sequência, badges e histórico.
Qual versão do Python?
Python 3.12. Toda pergunta sobre a saída foi conferida rodando o código.
Posso refazer?
Pode. Sua melhor nota fica salva, e as perguntas e respostas são embaralhadas a cada vez.