Run it! · Execute!
Start here
- A lesson is a list of short steps. Press Continue (the arrow at the bottom) for the next one.
- After the steps come tasks: code you change and run.
- Today you type very little. You change one small thing at a time.
Comece aqui
- Uma aula é uma lista de etapas curtas. Pressione Continuar (a seta na parte inferior) para a próxima.
- Depois das etapas vêm as tarefas: código que você altera e executa.
- Hoje você digita muito pouco. Você altera uma pequena coisa de cada vez.
The buttons
- Run ▶ runs the code. What it prints appears in the dark box under it.
- Check answer tests your code. Green means correct, and you win coins.
- The lightbulb gives a hint when you are stuck.
- Reset brings the starting code back.
Os botões
- Executar ▶ roda o código. O que imprime aparece na caixa escura abaixo.
- Verificar resposta testa seu código. Verde significa correto, e você ganha moedas.
- A lâmpada dá uma dica quando você está travado.
- Reiniciar traz o código inicial de volta.
print("I am an example. Press the play button to run me.")
When something goes wrong
- If the code has a mistake, Python stops and shows red text.
- Under the red text, a card explains the error in English and Chinese and tells you which line to look at.
- Mistakes are normal. Read the card, fix one thing, and run again.
Quando algo dá errado
- Se o código tiver um erro, o Python para e mostra texto vermelho.
- Abaixo do texto vermelho, um cartão explica o erro em inglês e chinês e diz qual linha verificar.
- Erros são normais. Leia o cartão, corrija uma coisa e execute novamente.
When a program waits for you
- Some programs ask a question with
input(). - Then a highlighted box appears: type here, then press Enter.
- Click the box, type your answer and press Enter. The program continues.
Quando um programa espera por você
- Alguns programas fazem perguntas com
input(). - Então uma caixa destacada aparece: digite aqui, depois pressione Enter.
- Clique na caixa, digite sua resposta e pressione Enter. O programa continua.
name = input("What is your name? ")
print("Nice to meet you, " + name)
Now you try
- Three small tasks. Change the code, press Run, then Check answer.
Agora você tenta
- Três pequenas tarefas. Altere o código, pressione Executar, depois Verificar resposta.
This program is switched off: the # at the start makes the line a comment, so Python skips it. Delete the #, press Run ▶ to see what it prints, then press Check answer. · Este programa está desligado: o # no início transforma a linha em comentário, então o Python a ignora. Apague o #, pressione Run ▶ para ver o que imprime, depois pressione Check answer.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
Change one word so the program prints I like dogs. Only the text inside the quotes changes. · Mude uma palavra para que o programa imprima I like dogs. Apenas o texto dentro das aspas muda.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
This program has a mistake. Press Run ▶ first and read the card under the red text: it explains the error. Then fix the line so the program prints Hello. · Este programa tem um erro. Pressione Run ▶ primeiro e leia o cartão sob o texto vermelho: ele explica o erro. Depois conserte a linha para que o programa imprima Hello.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.