Loading your page…
YOUR LEARNING PATH
Short exercises, progressive hints and explanations to help you move forward.
TRY WITHOUT AN ACCOUNT
Read a short example, predict the result and learn from the explanation. You can try as many times as you like.
price = 4
quantity = 3
print(price * quantity)Write your answer in the field above.
Expected: 12
The * operator multiplies 4 by 3 and print displays 12. Variable names explain their purpose; they do not change the calculation.
If price held the text "4", multiplying it by 3 would repeat that text and print 444.
This discovery session stays on this page. An account saves progress in the full course, with daily hearts for free learning.
Discover Python for scripts, lists and automated calculations. Move from basic syntax to programs organised into functions and classes.
Before you start: No prior knowledge needed. Pay attention to indentation from the first exercise.
prices = [3, 4, 5]
total = 0
for price in prices:
total += price
print(total) # 12The loop adds each price to total. The spaces before total += price put that instruction inside the loop. The program prints 12.
Try it: Add 8 to prices. Predict the new total and check it.
Want to understand what each plan includes? Compare plans
Python is the leading language for Artificial Intelligence, machine learning, data science, and automation. Its clean and readable syntax makes it the best starting language for beginners.
With 420 hands-on progressive challenges and an integrated browser execution console, beginners can master core fundamentals in a few weeks by practising 20 minutes daily.
No installation is required. All Python code is written and executed instantly in your web browser with immediate output console display.