Lecciones · Programación · principiante · Programming with Mosh

Python for Beginners - Learn Coding with Python in 1 Hour

El vídeo «Python for Beginners - Learn Coding with Python in 1 Hour» de Programming with Mosh convertido en 8 lecciones, con la idea explicada, el código de la pantalla, pasos para probar en la terminal de práctica, problemas de práctica con soluciones y un test que te lleva al momento exacto.

8lecciones
21fragmentos de código
4fórmulas
19ejercicios
60min de vídeo
Abrir las lecciones →La lección 1 es gratis · Beyond Pass lo abre todo

También en: English · Türkçe

El vídeo está en inglés. En el reproductor de YouTube, activa los subtítulos y elige Traducir automáticamente → Español.

Python for Beginners - Learn Coding with Python in 1 Hour, video by Programming with Mosh▶ 1:00:05 · Programming with Mosh
12345678
0:008 lecciones a lo largo de todo el vídeo1:00:05

Sabrás

  • Install Python and run a first program from the terminal or an editor
  • Create variables and choose appropriate data types for numbers, strings, and booleans
  • Write conditionals and loops to control program flow
  • Use lists, tuples, and dictionaries to store and organize data
  • Define and call functions with parameters and return values
  • Build a small complete Python program that combines these concepts

Conviene saber antes

  • Basic comfort using a computer and opening files
  • Ability to install software or follow setup instructions

Temario

8 lecciones y un proyecto final

  1. 1

    Setting up Python and writing a first program Gratis

    0:00–7:007 min de vídeo

    You will install Python and PyCharm, create a project and a Python file, and run your first lines of code with print(). You will also see how a variable stores a value that print() can show.

    2 de código7 pasos de construcción2 ejercicios3 preguntas
  2. 2

    Variables and data types Beyond Pass

    7:00–15:008 min de vídeo

    Aprenderás a guardar valores en variables, los tipos de datos básicos que usa Python (enteros, flotantes, cadenas y booleanos), y a pedir datos al usuario y convertirlos en un número. Al final podrás escribir un pequeño programa que pide un año de nacimiento y calcula una edad.

    3 de código3 pasos de construcción3 ejercicios3 preguntas
  3. 3

    Cadenas y entrada del usuario Beyond Pass

    15:00–21:006 min de vídeo

    Aprenderás cómo input() pide al usuario un texto y por qué todo valor que devuelve es una cadena. También aprenderás a convertir cadenas en números con float() y de nuevo en texto con str(), y a usar los métodos de una cadena con un punto.

    2 de código3 pasos de construcción2 ejercicios3 preguntas
  4. 4

    Condicionales y comparaciones Beyond Pass

    21:00–28:007 min de vídeo

    Esta lección muestra cómo Python comprueba texto y números con el operador in y el operador de resto %, y cómo calcula el orden de las operaciones en una línea de código. También muestra los operadores abreviados como += y -=.

    2 de código3 pasos de construcción2 ejercicios3 preguntas
  5. 5

    Condiciones en Python: if, elif y la lógica que hay detrás Beyond Pass

    28:00–35:007 min de vídeo

    En esta lección verás cómo Python comprueba condiciones con operadores de comparación y lógicos, y cómo if, elif y else deciden qué código se ejecuta. Escribirás y probarás pequeños programas que toman decisiones según un valor.

    3 de código3 fórmulas3 pasos de construcción2 ejercicios3 preguntas
  6. 6

    Condicionales en la práctica: elif, else y un conversor de peso Beyond Pass

    35:00–42:007 min de vídeo

    Esta lección muestra cómo encadenar varias condiciones con elif y terminar con un else que recoge todo lo demás. Después construye un pequeño conversor de peso que pide un valor y una unidad y elige el cálculo correcto.

    2 de código1 fórmula4 pasos de construcción3 ejercicios4 preguntas
  7. 7

    Escribir y llamar funciones en Python Beyond Pass

    42:00–49:007 min de vídeo

    Aprenderás qué es una función, cómo definirla con def y cómo llamarla. Verás cómo una función puede recibir entradas (parámetros) y reutilizarse muchas veces.

    2 de código2 pasos de construcción3 ejercicios3 preguntas
  8. 8

    Diccionarios y un mini proyecto Beyond Pass

    49:00–1:00:0511 min de vídeo

    Esta lección cubre las herramientas de listas y tuplas que muestra el video, como comprobar la pertenencia con "in", recorrer con for, usar range y contar elementos con count(). Termina con el inicio de un mini proyecto, y la transcripción de este capítulo es breve, así que la lección se limita a lo que muestran los fotogramas.

    5 de código2 pasos de construcción2 ejercicios3 preguntas

Proyecto final

Mini gastos de bolsillo: un programa completo de consola en Python

Crea un pequeño rastreador de gastos por línea de comandos que guarda los registros en listas, tuplas y diccionarios, pide datos al usuario con input() y los convierte con float(), toma decisiones con if/elif/else y reutiliza lógica mediante funciones. Reúne todos los resultados del curso en un solo programa funcional, y sigue el estilo del conversor de peso de la lección 6, pero para el dinero. El resultado muestra que los pequeños bloques del curso se combinan para formar una herramienta real.

Sus 7 tareas se abren con Beyond Pass.

Vista previa gratis · La lección 1 completa

Setting up Python and writing a first program

You will install Python and PyCharm, create a project and a Python file, and run your first lines of code with print(). You will also see how a variable stores a value that print() can show.

0:00 hasta 7:00 en el vídeo

Terminal de práctica

Escribe los comandos de la lección, rompe cosas y descubre por qué.

Zona de pruebas

Ejecuta y cambia el código, con Python y JavaScript de verdad.

Bloc de notas

Dibuja y escribe junto al vídeo.

La idea

To write Python you need two things: the Python interpreter, which runs your code, and an editor where you type it. The video installs Python from the official Python installer (on macOS it shows Python 3.8.1 for macOS 10.9 or later) and then installs PyCharm Community Edition, a free editor made for Python. You drag PyCharm into the Applications folder like any other Mac app.

Next, open PyCharm and create a new project, here named HelloWorld. A project is a folder that holds your Python files. Inside it, right-click the project and choose New, then Python file. Name the file app.py. The .py ending tells the computer this file contains Python code.

Your first program is one line: print("Hello World"). The word print is a built-in instruction that shows whatever you put inside the brackets on the screen. The text inside the quotation marks is a string, which is a piece of text. Run the program from the Run menu (Run...), and the output Hello World appears in the panel at the bottom.

Print can also show a value stored in a variable. A variable is a name that holds a value. The line age = 20 creates a variable called age and stores the number 20 in it. The line print(age) then shows 20. Notice the difference: print("age") would show the word age, while print(age) shows the value stored under that name.

In short, you install Python and an editor, make a project and a .py file, write instructions, and run them. Each run executes the file from top to bottom, one line after another.

Puntos clave

  • Python needs an interpreter (installed from the Python installer) and an editor such as PyCharm Community Edition. 1:51
  • A project is a folder for your files; a Python file ends with .py, for example app.py. 4:00
  • print("Hello World") shows the text Hello World; the text inside the quotes is a string. 5:01
  • Run... in the Run menu executes the file, and the output appears at the bottom of the window. 5:01
  • print(age) shows the value stored in the variable age, which is 20 after age = 20. 6:40

Código de la pantalla

First programpython 5:01 on screen
print("Hello World")

Save as app.py in your PyCharm project and press Run.

Printing a variablepython 6:40 on screen
age = 20
print(age)

Save as app.py in your PyCharm project and press Run.

Construye a la vez en la terminal de práctica

  1. Download and run the Python installer from python.org and click Continue through the steps until it finishes. 1:51Deberías ver: Python is installed on your computer.
  2. Drag PyCharm CE into the Applications folder, then open PyCharm. 3:01Deberías ver: PyCharm opens and is ready to create a project.
  3. Create a new project called HelloWorld. 4:00Deberías ver: The HelloWorld project appears in the Project panel.
  4. Right-click the project, choose New, then Python file, and name it app.py. 4:00Deberías ver: app.py opens in the editor.
  5. Type print("Hello World") into app.py. 5:01
    $ print("Hello World")
    Deberías ver: The line is shown in the editor.
  6. Choose Run from the Run menu (or press the run button). 5:01Deberías ver: The output Hello World appears at the bottom.
  7. Replace the code with age = 20 and print(age), then run again. 6:40
    $ print(age)
    Deberías ver: The output shows 20.

Práctica

Código Solución comprobada

Create a variable called name that stores the text "Sara" and print it.

# Write your code below
Pista

Strings go in quotes. A variable is made with name = value, and print(name) shows its value.

Solución
  1. Create the variable: name = "Sara".
  2. Print the variable: print(name).
  3. Running it shows Sara (no quotes, because print shows the value).
name = "Sara"
print(name)

Sara

Calcula Solución comprobada

A file has these lines: age = 20, then print(age), then age = 25, then print(age). What are the two numbers printed, added together?

Pista

Lines run from top to bottom, so the second print sees the new value of age.

Solución
  1. The first print(age) runs when age is 20, so it prints 20.
  2. Then age becomes 25, and the second print(age) prints 25.
  3. 20 + 25 = 45.

45

En tu bloc de notas

Draw a box labelled age, and write 20 inside it. Next to it, sketch what print(age) puts on the screen.

Test

  1. What does the file ending .py tell the computer?

    1. The file is a picture
    2. The file contains Python code
    3. The file is a folder
    4. The file is encrypted
    Mostrar la respuesta

    B. The file contains Python code · Files ending in .py hold Python code that the interpreter can run.

    4:00 ver el momento
  2. After age = 20, what does print(age) show?

    1. age
    2. 20
    3. age = 20
    4. an error
    Mostrar la respuesta

    B. 20 · print(age) shows the value stored in the variable age, which is 20.

    6:40 ver el momento
  3. Which editor does the video install to write Python?

    1. Word
    2. PyCharm Community Edition
    3. Excel
    4. Photoshop
    Mostrar la respuesta

    B. PyCharm Community Edition · The video installs PyCharm Community Edition, a free Python editor.

    3:01 ver el momento

Abrir la lección 1, con el vídeo →

Lecciones 2–8 y el proyecto final

Se abren con Beyond Pass: todas las lecciones de todos los cursos, completas. Un solo pago: 14,99 $ por 90 días o 29 $ por un año. Sin suscripción.

Hecho por Beyond a partir del vídeo «Python for Beginners - Learn Coding with Python in 1 Hour» de Programming with Mosh. El vídeo se reproduce en el propio reproductor de YouTube. Míralo en YouTube · Todas las lecciones