DEV Community

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

Posted on • Edited on

1

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

Explica este código Python

Dificultad: Fácil

# ¿Cuál de las siguientes sentencias es la incorrecta? 
x = "hola"
print("El valor de a es: " + x) # A
print("El valor de a es:", x) # B
print(f"El valor de a es: {x}") # C
Enter fullscreen mode Exit fullscreen mode

👉 A. A
👉 B. B
👉 C. C
👉 D. Todas son correctas


Respuesta:

👉 D. Todas son correctas

En Python podemos concatenar valores de muchas maneras, 3 de ellas son:

  • Usando el operador +.
  • Usando una simple ,.
  • Usando lo que se denomina un f-string e interpolar el valor final.

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay