Getting started
Run your first program, use variables and understand Python's type system.
What you will be able to do
- Print output
- Store and name values
- Convert between types
Python programs read top to bottom. There are no semicolons and no braces — indentation defines blocks, so keep it consistent.
name = "Amina"
completed = 7
total = 10
percent = round(completed / total * 100)
print(f"{name} has completed {percent}% of the course.")| Type | Example |
|---|---|
| str | "hello" |
| int | 42 |
| float | 3.14 |
| bool | True / False |
| list | [1, 2, 3] |
| dict | {"name": "Amina"} |
Your turn
EasyCalculate a total
Given price = 24.5 and quantity = 3, print a sentence with the total using an f-string.
PYTHON · starter
price = 24.5
quantity = 3
# your code hereCheck your understanding before moving on.
Knowledge checkQuestion 1
What defines a block of code in Python?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.