DEV Community

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

Posted on

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

Explica este código Python

Dificultad: Intermedio

y = 8
z = lambda x : x * y
print (z(6))
Enter fullscreen mode Exit fullscreen mode
  • A. 48
  • B. 14
  • C. 64
  • D. Error

Respuesta:

👉 A. 48

La función lambda solo recibe como parámetro x pero en el cuerpo de la función multiplicamos x * y. y es solo una variable global pero que puede ser accedida por la función para poder hacer el producto.

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

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

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

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay