Your first program · Tu primer 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.
Bienvenido
- Python sigue tus instrucciones, una línea a la vez.
- Escribe código aquí y ejecútalo — no necesitas instalar nada.
- Lee cada paso, luego presiona Continuar.
Show text with print
print(...)shows text on the screen.- Put the text in quotes:
"...". - Each
printstarts a new line.
Mostrar texto con print
print(...)muestra texto en la pantalla.- Coloca el texto entre comillas:
"...". - Cada
printcomienza en una línea nueva.
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).
Cadenas de texto
- El texto entre comillas se llama cadena (string).
- Puedes usar comillas dobles
"..."o simples'...'. - También puedes imprimir un número sin comillas, 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.
Comentarios
- Una línea que comienza con
#es un comentario. - Python ignora los comentarios — no se ejecutan.
- Úsalos para dejar notas para las personas que lean tu 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.
Errores comunes
printnecesita comillas alrededor del texto:print("Hi"), noprint(Hi).- Python distingue mayúsculas y minúsculas:
Printno es lo mismo queprint.
Now you try
- Below are a few tasks. Type your code and press Run.
- Press Check answer to see if it is correct.
Ahora tú intentas
- Abajo hay varias tareas. Escribe tu código y presiona Ejecutar.
- Presiona Verificar respuesta para ver si es correcta.
How a program runs · Cómo se ejecuta un programa
A program runs top to bottom, one statement at a time. · Un programa se ejecuta de arriba hacia abajo, una declaración a la vez.
Use print(...) to make Python show the words Hello, world! exactly (same spelling, same punctuation). · Usa print(...) para que Python muestre Hello, world! exactamente (con la misma ortografía y puntuación).
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.
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.) · Imprime dos líneas. La primera línea debe ser My name is Pat. La segunda línea debe ser I am learning Python. (Usa dos llamadas print(...).)
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.
Keep the comment line, then print the number 42. Notice the comment never appears in the output. · Mantén la línea de comentario, luego print el número 42. Nota que el comentario nunca aparece en la salida.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.
Print a box made of three lines: first +-----+, then | Hi! |, then +-----+ again. · Imprime una caja hecha de tres líneas: primero +-----+, luego | Hi! |, y luego +-----+ nuevamente.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.