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

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!

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"

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 desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 1. Chapter 3
toggle bottom row

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!

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"

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 desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 1. Chapter 3
toggle bottom row

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!

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"

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 desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

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 desktop for real-world practiceContinue from where you are using one of the options below
Section 1. Chapter 3
Switch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt