DEV Community

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

Posted on

1

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

Explica este código Python

Dificultad: Fácil

x = "Pepinillos"
z = (x[2:6] == "pini")
z = int(z)
print(z)
Enter fullscreen mode Exit fullscreen mode
  • A. 1
  • B. 2
  • C. 3
  • D. Error

Respuesta:

👉 A. 1

La condición (x[2:6] == "pini") evalúa True, luego intentamos convertir a entero dicho valor booleano, esto en Python es completamente posible siendo False equivalente a 0, y True equivalente a 1.

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more