Curso Completo De Python Programacion En Python Desde Cero ((top)) May 2026

def agregar_tarea(tareas, desc): tareas.append({"descripcion": desc, "completada": False}) print("Tarea agregada.")

try: numero = int(input("Dame un número: ")) resultado = 10 / numero print(resultado) except ValueError: print("Eso no es un número válido") except ZeroDivisionError: print("No se puede dividir entre cero") except Exception as e: print(f"Error inesperado: {e}") else: print("Todo salió bien") # se ejecuta si no hay excepción finally: print("Esto siempre se ejecuta")

# Aritméticos: + - * / // % ** print(10 / 3) # 3.333... print(10 // 3) # 3 (división entera) print(10 % 3) # 1 (resto) print(2 ** 3) # 8 (potencia) Lógicos: and or not 5. Estructuras de Control Condicionales (if/elif/else) curso completo de python programacion en python desde cero

(inmutables)

# Método especial (representación) def __str__(self): return f"Perro({self.nombre}, {self.edad})" mi_perro = Perro("Rex", 3) mi_perro.ladrar() print(mi_perro) def agregar_tarea(tareas, desc): tareas

def potencia(base, exponente=2): return base ** exponente print(potencia(3)) # 9 print(potencia(3, 3)) # 27

import pandas as pd datos = {'Nombre': ['Ana','Luis'], 'Edad': [25,30]} df = pd.DataFrame(datos) print(df.describe()) (visualización) desc): tareas.append({"descripcion": desc

numero = "123" convertido = int(numero) # 123 texto = str(456) # "456"

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare