DEV Community

Cover image for Ibuprofeno.py💊| #158: Explica este código Python
Cristian Fernando
Cristian Fernando

Posted on

1

Ibuprofeno.py💊| #158: Explica este código Python

Explica este código Python

Dificultad: Fácil

r = '123'
print(r.split( ))
Enter fullscreen mode Exit fullscreen mode
  • A. []
  • B. ["1", "2", "3"]
  • C. ["123"]
  • D. None

Respuesta:

👉 C. ["123"]

split() convierte una cadena en un arreglo.
En nuestro ejemplo usamos como separador un espacio en blanco pero puesto que nuestra cadena r no contiene espacios en blanco entonces nuestra lista solo tendrá un elemento "123".

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay