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

Cursusinhoud

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
Taak

Swipe to start coding

A teacher is dividing 47 students into groups of 6.

Your task:

  • Create a variable called extra_students.
  • Find the remainder when the number of students is divided by 6.
  • Store the remainder in the variable extra_students.
  • Use the modulus operator (%) to find the remainder.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 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
Taak

Swipe to start coding

A teacher is dividing 47 students into groups of 6.

Your task:

  • Create a variable called extra_students.
  • Find the remainder when the number of students is divided by 6.
  • Store the remainder in the variable extra_students.
  • Use the modulus operator (%) to find the remainder.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 3
Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Onze excuses dat er iets mis is gegaan. Wat is er gebeurd?
some-alt