Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn How to Work with Variables in Python | Variables and Types in Python
Introduction to Python
course content

Course Content

Introduction to Python

Introduction to Python

1. First Acquaintance with Python
2. Variables and Types in Python
3. Conditional Statements in Python
4. Other Data Types in Python
5. Loops in Python
6. Functions in Python

book
How to Work with Variables in Python

Imagine you got the cost of an item saved in the price variable and you want to apply a 15% discount. You can simply reassign the updated value like this:

1234567
# Initial price price = 50 # Applying the discount price = price * (1 - 0.15) print(price)
copy
Task

Swipe to start coding

  1. A teacher is dividing 47 students into groups of 6. Your task is to determine how many students will not fit into a complete group and store this remainder in the students variable.

Solution

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 2. Chapter 3
toggle bottom row

book
How to Work with Variables in Python

Imagine you got the cost of an item saved in the price variable and you want to apply a 15% discount. You can simply reassign the updated value like this:

1234567
# Initial price price = 50 # Applying the discount price = price * (1 - 0.15) print(price)
copy
Task

Swipe to start coding

  1. A teacher is dividing 47 students into groups of 6. Your task is to determine how many students will not fit into a complete group and store this remainder in the students variable.

Solution

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 2. Chapter 3
Switch to desktopSwitch 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