You've learned this already. ✅
Click here to view the next lesson.
Capítulo 22 - Apéndice C: Hoja de trucos de Python
Sintaxis Básica de Python
- Función Print
print("Hello, World!")
- Asignación de Variables
x = 5
y = "Hello, World!"
- Comentarios
# This is a single line comment
"""
This is a
multi-line comment
"""
- Instrucciones Condicionales
if x > y:
print("x is greater than y")
elif x < y:
print("x is less than y")
else:
print("x is equal to y")
- Bucles
for i in range(5):
print(i)
while x < 10:
print(x)
x += 1
- Funciones
def my_function():
print("Hello from a function")
Sintaxis Básica de Python
- Función Print
print("Hello, World!")
- Asignación de Variables
x = 5
y = "Hello, World!"
- Comentarios
# This is a single line comment
"""
This is a
multi-line comment
"""
- Instrucciones Condicionales
if x > y:
print("x is greater than y")
elif x < y:
print("x is less than y")
else:
print("x is equal to y")
- Bucles
for i in range(5):
print(i)
while x < 10:
print(x)
x += 1
- Funciones
def my_function():
print("Hello from a function")
Sintaxis Básica de Python
- Función Print
print("Hello, World!")
- Asignación de Variables
x = 5
y = "Hello, World!"
- Comentarios
# This is a single line comment
"""
This is a
multi-line comment
"""
- Instrucciones Condicionales
if x > y:
print("x is greater than y")
elif x < y:
print("x is less than y")
else:
print("x is equal to y")
- Bucles
for i in range(5):
print(i)
while x < 10:
print(x)
x += 1
- Funciones
def my_function():
print("Hello from a function")
Sintaxis Básica de Python
- Función Print
print("Hello, World!")
- Asignación de Variables
x = 5
y = "Hello, World!"
- Comentarios
# This is a single line comment
"""
This is a
multi-line comment
"""
- Instrucciones Condicionales
if x > y:
print("x is greater than y")
elif x < y:
print("x is less than y")
else:
print("x is equal to y")
- Bucles
for i in range(5):
print(i)
while x < 10:
print(x)
x += 1
- Funciones
def my_function():
print("Hello from a function")