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

Course Content

Learn Python from Scratch

Learn Python from Scratch

1. The basics
2. Arithmetic operations
3. Common data types
4. Conditional statements
5. Other data types
6. Loops
7. Functions

bookVariables

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!

Task

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"

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 3
toggle bottom row

bookVariables

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!

Task

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"

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 3
toggle bottom row

bookVariables

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!

Task

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"

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

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!

Task

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"

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 1. Chapter 3
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
some-alt