Learning Python

sábado, 4 de enero de 2025

Python Range

 >>> 

>>> [a for a in range(2,11,2) ]

[2, 4, 6, 8, 10]

>>> [a for a in range(2,11,2) if a>4]

[6, 8, 10]

>>> [a**2 for a in range(2,11,2) if a>4]

[36, 64, 100]

>>> 


Publicado por Ambiorix Rodriguez en 17:24
Enviar por correo electrónicoEscribe un blogCompartir en XCompartir con FacebookCompartir en Pinterest

No hay comentarios:

Publicar un comentario

Entrada más reciente Entrada antigua Inicio
Suscribirse a: Enviar comentarios (Atom)

Archivo del blog

  • ▼  2025 (9)
    • ►  mayo (1)
    • ►  abril (1)
    • ►  marzo (1)
    • ►  febrero (2)
    • ▼  enero (4)
      • using cases with dict
      • https://cloud.google.com/video-intelligence/docs/s...
      • Python Range
      • filtering a list with other list
  • ►  2024 (67)
    • ►  diciembre (5)
    • ►  noviembre (5)
    • ►  octubre (12)
    • ►  septiembre (14)
    • ►  agosto (14)
    • ►  julio (11)
    • ►  junio (6)
  • ►  2023 (3)
    • ►  octubre (1)
    • ►  marzo (1)
    • ►  febrero (1)
  • ►  2022 (1)
    • ►  julio (1)
  • ►  2021 (2)
    • ►  junio (1)
    • ►  marzo (1)
  • ►  2020 (2)
    • ►  julio (1)
    • ►  febrero (1)
  • ►  2019 (7)
    • ►  agosto (1)
    • ►  julio (3)
    • ►  mayo (1)
    • ►  marzo (2)
  • ►  2018 (57)
    • ►  diciembre (3)
    • ►  noviembre (1)
    • ►  octubre (1)
    • ►  junio (2)
    • ►  abril (1)
    • ►  marzo (5)
    • ►  febrero (3)
    • ►  enero (41)
Tema Sencillo. Con la tecnología de Blogger.