DEV Community

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

Posted on • Edited on

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

Explica este código Python

Dificultad: Fácil

print( ((True / True) - 10 ) * 9)
Enter fullscreen mode Exit fullscreen mode

👉 A. 80
👉 B. 81
👉 C. -81
👉 D. SyntaxError


Respuesta:

👉 C. -81

Nuevamente operaciones aritméticas con booleanos:

  • True / True es lo mismo que 1/1, por lo tanto nos da 1.
  • 1 - 10 nos dará -9
  • Y -9 * 9 será -81 como resultado final.

Top comments (0)

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay