Your first program · Seu primeiro programa
Welcome
- Python follows your instructions, one line at a time.
- You write code here and run it — nothing to install.
- Read each step, then press Continue.
Bem-vindo
- Python segue suas instruções, uma linha de cada vez.
- Você escreve código aqui e o executa — nada para instalar.
- Leia cada etapa, depois pressione Continuar.
Show text with print
print(...)shows text on the screen.- Put the text in quotes:
"...". - Each
printstarts a new line.
Mostrar texto com print
print(...)mostra texto na tela.- Coloque o texto entre aspas:
"...". - Cada
printcomeça uma nova linha.
print("Welcome to Python!")
print("This line runs next.")
Strings
- Text in quotes is called a string.
- You can use double quotes
"..."or single quotes'...'. - You can also print a number with no quotes, like
print(42).
Strings
- Texto entre aspas é chamado de string.
- Você pode usar aspas duplas
"..."ou aspas simples'...'. - Você também pode imprimir um número sem aspas, como
print(42).
Comments
- A line that starts with
#is a comment. - Python ignores comments — they do not run.
- Use them to leave notes for people who read your code.
Comentários
- Uma linha que começa com
#é um comentário. - Python ignora comentários — eles não rodam.
- Use-os para deixar notas para quem ler seu código.
# This line is a note for people. Python skips it.
print("Comments do not show.")
Common mistakes
printneeds quotes around text:print("Hi"), notprint(Hi).- Python is case-sensitive:
Printis not the same asprint.
Erros comuns
printprecisa de aspas ao redor do texto:print("Hi"), nãoprint(Hi).- Python é sensível a maiúsculas/minúsculas:
Printnão é o mesmo queprint.
Now you try
- Below are a few tasks. Type your code and press Run.
- Press Check answer to see if it is correct.
Agora você tenta
- Abaixo estão algumas tarefas. Digite seu código e pressione Executar.
- Pressione Verificar resposta para ver se está correto.
How a program runs · Como um programa roda
A program runs top to bottom, one statement at a time. · Um programa roda de cima para baixo, uma instrução por vez.
Use print(...) to make Python show the words Hello, world! exactly (same spelling, same punctuation). · Use print(...) para fazer o Python mostrar as palavras Hello, world! exatamente (mesma grafia, mesma pontuação).
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
Print two lines. The first line must be My name is Pat. The second line must be I am learning Python. (Use two print(...) calls.) · Imprima duas linhas. A primeira linha deve ser My name is Pat. A segunda linha deve ser I am learning Python. (Use duas chamadas de print(...).)
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
Keep the comment line, then print the number 42. Notice the comment never appears in the output. · Mantenha a linha de comentário, então print o número 42. Note que o comentário nunca aparece na saída.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
Print a box made of three lines: first +-----+, then | Hi! |, then +-----+ again. · Imprima uma caixa feita de três linhas: primeiro +-----+, depois | Hi! |, depois +-----+ novamente.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.