Python Foundations·First steps

Getting started

Run your first program, use variables and understand Python's type system.

Beginner 10 min read Lesson 1 of 480 Challenge included
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.

progress.pyPython
name = "Amina"
completed = 7
total = 10
percent = round(completed / total * 100)

print(f"{name} has completed {percent}% of the course.")
TypeExample
str"hello"
int42
float3.14
boolTrue / False
list[1, 2, 3]
dict{"name": "Amina"}
Your turn

Calculate a total

Easy

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 here
Check 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 in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Control flow
Lesson 1 of 480 · 0% of course