Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Variables | The basics
Learn Python from Scratch

book
Variables

In the previous example you used something called variable (in that specific example the variable was called "person").

Variable is a reserved memory location to store value (stored value can be of various allowed types). You can assign variable once and print it (or otherwise manupulate it) as many times as you want later!

Tarea

Swipe to start coding

Analyze the code snippet on the right! Replace ___ symbols in line 1 with proper variable name (the one that used in the lines below) so that the program prints lyrics from Rick Astley's timeless hit "Never Gonna Give You Up"

Solución

text = 'Never gonna'
print(text, "give you up")
print(text, "let you down")
print(text, "run around and desert you")
print(text, "make you cry")
print(text, "say goodbye")
print(text, "tell a lie and hurt you")

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 3
single

single

___ = 'Never gonna'
print(text, "give you up")
print(text, "let you down")
print(text, "run around and desert you")
print(text, "make you cry")
print(text, "say goodbye")
print(text, "tell a lie and hurt you")

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt