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.

Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
Business geek community. The number of iot devices is growing fast, from 22 billion in 2018 to 50 billion by 2030. Ai can tailor in game content to individual players based on their preferences and play style.