Week 1: Introduction to Python — Setup, print, Variables, Data Types and Operators
Month 1 | Main goal: The student can write and run a small Python program that takes input, does calculations, and displays the results.
Teacher Preparation (read before the week starts)
- Install on your first computer (the one you will share your screen from):
- Python 3.12 or later from https://www.python.org/downloads/windows/ — during installation tick "Add python.exe to PATH" (this is very important).
- VS Code from https://code.visualstudio.com/
- Inside VS Code: Extensions (Ctrl+Shift+X) → search for "Python" (by Microsoft) → Install.
- Try it yourself first: open PowerShell and type
python --version. If you seePython 3.12.x(or later), you are ready. If you see a Microsoft Store message or "not recognized", see the "Common mistakes" section of Session 1. - Create the folder
C:\Users\<jina>\Documents\python_darasa\wiki01— we will create files inside it in every session. - In Google Meet: try "Present now → A window → VS Code". Increase the VS Code font size: press
Ctrl + =3–4 times so the student can see clearly. - Read: https://docs.python.org/3/tutorial/introduction.html. Don't worry about understanding everything.
- Ask the student to install Python and VS Code themselves. If they can't manage it, Session 1 will help them.
Week Goals (by the end of the week the student will be able to...)
- Install Python and VS Code, and run a
.pyfile from VS Code and PowerShell. - Use the REPL (
>>>) to try out short pieces of code. - Use
print()and comments (#). - Create variables and know the data types
int,float,str,bool, and usetype(). - Receive data with
input()and convert data types (type conversion):int(),float(),str(). - Use arithmetic operators (
+ - * / // % **), comparison operators (== != < > <= >=) and logical operators (and or not). - Write a small complete program: e.g. a BMI calculator or a product price calculator.
Session 1 — Introduction, Setup, REPL, print and comments
Session flow
- Getting to know each other, course goals, how we will work (Meet + VS Code)
- What is Python? What is a program? Why Python?
- Setup: make sure Python + VS Code + the extension are installed for the student
- REPL:
pythonin PowerShell, trying out calculations - Short break
- First file
salamu.py(greetings):print(), running it with ▶ and withpython salamu.py - Comments
#and the first errors (SyntaxError, NameError) - In-class exercise
- Q&A + homework
Explanation for the teacher (read this first)
- A program is a list of instructions that the computer follows in order, line by line, from top to bottom.
- Python is a programming language. We write instructions in a file ending in
.py, then a program called the interpreter (python.exe) reads that file and carries out the instructions. - VS Code is an "editor" — it is like Microsoft Word, but for code. VS Code itself is not Python; it uses the Python you installed.
- Terminal / PowerShell is a window for typing text commands. Inside VS Code you open it with
Ctrl + `(the key above Tab). - REPL (Read–Eval–Print Loop): when you type
pythonin the terminal you get the>>>prompt. You type one line and Python answers immediately. It is like a "calculator for experiments". To exit: typeexit()or pressCtrl+Zthen Enter (Windows). - Key difference: the REPL shows values without
print. In a file, you must useprint()to see anything. print()is a function that displays text on the screen. Text must be inside quotation marks,"..."or'...'.- A comment is a line starting with
#. Python ignores it. It is there for humans to read. - Python is case-sensitive:
printis not the same asPrint.
Say this to the student
- "Imagine the computer is a cook who knows nothing at all. You are the one writing the recipe (the program). The cook follows every step exactly as written — even if you make a mistake, the cook will follow your mistake! That's why we say a computer is a 'very fast fool'."
- "Python is a language that both humans and computers understand easily. It is used by Instagram, YouTube, NASA, and in AI."
- "VS Code is our notebook. The terminal is where we give the computer commands one at a time."
- "The REPL is like talking to Python face to face: you ask, it answers immediately. A
.pyfile is like writing it a long letter — it reads the whole thing, then acts on it." - "A comment is like a pencil note in the margin of your notebook — the teacher (Python) doesn't read it; it's for you."
Type this code live (share screen)
Step 1 — Checking that Python is there. Open PowerShell (or the terminal inside VS Code):
python --version
Expected output (the number may differ):
Python 3.12.7
If python doesn't work, try py --version (the Windows Python Launcher).
Step 2 — REPL.
python
>>> 2 + 3 5 >>> 10 * 4 40 >>> 7 / 2 3.5 >>> "Habari" 'Habari' >>> print("Habari Tanzania") Habari Tanzania >>> exit()
Explain: "Look, 'Habari' (hello) was shown with quotes — the REPL shows the value itself. print shows 'clean' text without quotes."
Step 3 — First file. VS Code → File → Open Folder → choose wiki01. Create a new file salamu.py:
# Programu yangu ya kwanza # Mwandishi: <jina la mwanafunzi> print("Habari, dunia!") print("Karibu kwenye darasa la Python") print("Leo ni siku ya kwanza")
Press ▶ (Run Python File) at the top right. Output:
Habari, dunia! Karibu kwenye darasa la Python Leo ni siku ya kwanza
Then show the second way, in the terminal:
python salamu.py
Step 4 — print with several items.
print("Jina:", "Amina") # print inaweka nafasi (space) kati ya vitu print("Umri:", 20) print(5 + 7) # inahesabu kwanza, kisha inaonyesha print("5 + 7") # hii ni maandishi tu, haihesabu! print() # mstari mtupu print("Dar", "Arusha", "Mwanza", sep=" - ") print("Hakuna mstari mpya", end=" ") print("<- tuko mstari ule ule")
Output:
Jina: Amina Umri: 20 12 5 + 7 Dar - Arusha - Mwanza Hakuna mstari mpya <- tuko mstari ule ule
Step 5 — Quotes inside text.
print('Alisema "Asante"') print("It's a nice day") print("Mstari wa kwanza\nMstari wa pili") # \n = mstari mpya print("Jina:\tAmina") # \t = tab
Output:
Alisema "Asante" It's a nice day Mstari wa kwanza Mstari wa pili Jina: Amina
Step 6 — Make a mistake on purpose so the student doesn't fear errors:
Print("Habari")
NameError: name 'Print' is not defined. Did you mean: 'print'?
"An error is not the enemy — it is Python telling you where the problem is. Read the last line first."
Questions to ask the student
- Question: What is the difference between the REPL and a
.pyfile? — Answer: The REPL answers one line immediately and doesn't save your work; a file is saved and runs all at once. - Question: What do
print("3 + 4")andprint(3 + 4)output? — Answer: The first gives3 + 4(text), the second gives7(a calculation). - Question: What does a line starting with
#do? — Answer: Nothing; it is a comment, and Python ignores it. - Question: What happens if you write
print(Habari)without quotes? — Answer:NameError, because Python thinksHabariis a variable name. - Question: In what order does Python read a file? — Answer: Top to bottom, line by line.
Common mistakes
| Mistake | Error message | Fix |
|---|---|---|
| Python was not added to PATH | python : The term 'python' is not recognized... or it opens the Microsoft Store |
Reinstall with "Add python.exe to PATH" ticked, or use py instead of python. Close and reopen VS Code. |
| Typing Python code directly into PowerShell (not the REPL) | print : The term 'print' is not recognized or a PowerShell error |
Type python first to enter the REPL, or put the code in a .py file. |
| Typing a PowerShell command inside the REPL | >>> python salamu.py → SyntaxError: invalid syntax |
Exit the REPL with exit() first. |
| Forgetting quotes | NameError: name 'Habari' is not defined |
Put text inside "...". |
| Mismatched quotes | SyntaxError: unterminated string literal |
Start and end with the same mark: "..." or '...'. |
| Forgetting parentheses | print "Habari" → SyntaxError: Missing parentheses in call to 'print' |
Use print("Habari"). |
| Capital letters | Print(...) → NameError |
Python is case-sensitive: print. |
| The file wasn't saved | The program runs the old version | Ctrl+S before running (or turn on File → Auto Save). |
In-class exercise
- Create
kadi.py(card) that displays an ID card: name, town, school/work, and something you like — each on its own line, with a comment at the top explaining what the file does. - Use only one
print(with\n) to display three lines:Moja,Mbili,Tatu(one, two, three). - In the REPL, calculate: how many seconds are there in one day?
Answer
# kadi.py — inaonyesha kadi ya utambulisho print("==== KADI YANGU ====") print("Jina: Amina Juma") print("Mji: Dodoma") print("Shule: Sekondari ya Jamhuri") print("Ninapenda: Mpira wa miguu") print("====================")
print("Moja\nMbili\nTatu")
>>> 60 * 60 * 24 86400
Session 2 — Variables, Data Types, type(), input() and Type Conversion
Session flow
- Homework review (card + print)
- Variables: what they are, how to name them (naming rules), changing a value
- Data types:
int,float,str,bool+type() - Break
input()— receiving data from the user- Type conversion:
int(),float(),str(),bool() - In-class exercise
- Q&A + homework
Explanation for the teacher (read this first)
- A variable is a name that holds (points to) a value.
umri = 20(umri= age) means "the nameumrinow holds 20". The=sign is not the "equals" of mathematics; it is assignment ("put"). The right-hand side is calculated first, then the result is stored in the name on the left. - You can change the value:
umri = 21— the old value is lost. - Naming rules: names start with a letter or
_; they may contain letters, numbers and_; they cannot contain spaces or-; they cannot start with a number; they cannot be Python keywords (if,for,class...). Python style:snake_case(lowercase letters +_), e.g.jina_kamili(full name). - The 4 main data types:
int— whole numbers:5,-3,0,1_000_000float— numbers with decimals:3.14,2.0,-0.5str(string) — text inside quotes:"Amina","25"(this is a str, not a number!)bool— onlyTrueorFalse(capital first letter)
type(x)tells you the type ofx:type(5)→<class 'int'>.input("ujumbe")pauses the program, shows the message, and waits for the user to type something and press Enter. It always returns astr— even if the user types25, you get"25".- Type conversion:
int("25")→25;float("2.5")→2.5;str(25)→"25";int(3.9)→3(it cuts off the decimals, it doesn't round);int("2.5")→ ValueError;bool(0)→False,bool("")→False, almost everything else →True. - Joining strings:
"Habari " + "Amina"→"Habari Amina". But"Umri: " + 20→ TypeError. Fix:"Umri: " + str(20)orprint("Umri:", 20).
Say this to the student
- "A variable is like a labelled box. The label is the name (
umri), and inside the box is the value (20). If you put in something new, the old thing is taken out." - "In Python we read the
=sign as 'put'.x = 5→ 'put 5 into x'. It isn't a question, it's an instruction." - "Data types are like the kinds of goods at the market: fruit is weighed by the kilo (float), eggs are counted one by one (int), the shop's name is text (str), and 'is the shop open?' has a yes/no answer (bool)."
- "
input()is like a bank clerk handing you a form — whatever you write, the clerk receives it as text. If you want to do calculations, you have to convert it to a number."
Type this code live (share screen)
Step 1 — variables.py
jina = "Baraka" umri = 19 urefu = 1.72 ni_mwanafunzi = True print(jina) print(umri) print(urefu) print(ni_mwanafunzi)
Output:
Baraka 19 1.72 True
Step 2 — Changing a value and using a variable in a calculation
umri = 19 print("Umri sasa:", umri) umri = umri + 1 # chukua umri wa sasa, ongeza 1, weka tena kwenye umri print("Mwaka ujao:", umri) a = 10 b = a # b inapata 10 a = 99 print(a, b) # b haibadiliki
Output:
Umri sasa: 19 Mwaka ujao: 20 99 10
Step 3 — type()
print(type(19)) print(type(1.72)) print(type("Baraka")) print(type(True)) print(type("19")) # angalia! hii ni str
Output:
<class 'int'> <class 'float'> <class 'str'> <class 'bool'> <class 'str'>
Step 4 — input() (file salamu2.py)
jina = input("Jina lako ni nani? ") mji = input("Unaishi mji gani? ") print("Karibu", jina, "kutoka", mji)
Sample run:
Jina lako ni nani? Neema Unaishi mji gani? Mbeya Karibu Neema kutoka Mbeya
Explain: "Notice the space after ? inside the message — it makes the user type after a space."
Step 5 — The problem with input and numbers (show the mistake first!)
umri = input("Una miaka mingapi? ") print(type(umri)) print(umri + 1)
Una miaka mingapi? 20 <class 'str'> TypeError: can only concatenate str (not "int") to str
Then fix it:
umri = int(input("Una miaka mingapi? ")) print(type(umri)) print("Mwaka ujao utakuwa na miaka", umri + 1)
Una miaka mingapi? 20 <class 'int'> Mwaka ujao utakuwa na miaka 21
Step 6 — More conversion (REPL)
>>> int("42") 42 >>> float("3.5") 3.5 >>> int(7.9) 7 >>> round(7.9) 8 >>> str(100) + " shilingi" '100 shilingi' >>> "5" + "5" '55' >>> int("5") + int("5") 10 >>> bool(0), bool(5), bool(""), bool("hapana") (False, True, False, True) >>> int("2.5") ValueError: invalid literal for int() with base 10: '2.5' >>> int(float("2.5")) 2
Questions to ask the student
x = 5thenx = x * 2— what isx? — Answer: 10.- What is
type("3.14")? — Answer:<class 'str'>(it is inside quotes). - Why does
input()+ a calculation cause an error? — Answer:inputalways returns astr; we must useint()orfloat(). - Which variable names are invalid:
jina_1,1jina,jina-kwanza,_siri,for? — Answer:1jina(starts with a number),jina-kwanza(contains-),for(a Python keyword). - What does
int(9.99)give? — Answer:9(it cuts off, it doesn't round). - What does
"10" + "20"give? — Answer:"1020"— it joins the text.
Common mistakes
| Mistake | Error message | Fix |
|---|---|---|
| Joining a str and an int | TypeError: can only concatenate str (not "int") to str |
str(namba) or use a comma in print. |
| Using a variable before creating it | NameError: name 'jumla' is not defined |
Assign a value first; check the spelling. |
Converting "2.5" with int() |
ValueError: invalid literal for int() with base 10: '2.5' |
Use float(). |
| The user types letters instead of a number | ValueError: invalid literal for int() with base 10: 'ishirini' |
For now: tell them to type a number. (We will learn try/except later.) |
true instead of True |
NameError: name 'true' is not defined |
True / False with a capital first letter. |
| A space inside a name | jina kamili = "Ali" → SyntaxError: invalid syntax |
jina_kamili. |
Reversing the sides: 5 = x |
SyntaxError: cannot assign to literal |
Name on the left, value on the right: x = 5. |
In-class exercise
- Write a program that asks for a name and year of birth, then displays "Habari
, mwaka 2026 utatimiza miaka " (Hello , in 2026 you will turn ). - Ask for the price of an item (it may have decimals) and the quantity, and display the total.
- Without running anything, predict the
type()of:10,10.0,"10",10 > 5. Then confirm with code.
Answer
# zoezi 1 jina = input("Jina lako: ") mwaka = int(input("Mwaka wa kuzaliwa: ")) umri = 2026 - mwaka print("Habari", jina + ", mwaka 2026 utatimiza miaka", umri)
# zoezi 2 bei = float(input("Bei ya kitu kimoja: ")) idadi = int(input("Idadi: ")) jumla = bei * idadi print("Jumla ni:", jumla)
# zoezi 3: int, float, str, bool print(type(10), type(10.0), type("10"), type(10 > 5)) # <class 'int'> <class 'float'> <class 'str'> <class 'bool'>
Session 3 — Operators: Arithmetic, Comparison, Logical
Session flow
- Homework review (input + conversion)
- Arithmetic operators:
+ - * / // % **, order of operations (precedence), shortcuts+= - Comparison operators:
== != < > <= >=— the result is abool - Break
- Logical operators:
and,or,not - Mini project: BMI calculator / shop price calculator
- Review of the whole week
- Q&A + homework
Explanation for the teacher (read this first)
-
Arithmetic operators: | Operator | Meaning | Example | Result | |---|---|---|---| |
+| add |7 + 2|9| |-| subtract |7 - 2|5| |*| multiply |7 * 2|14| |/| divide (the result is always a float) |7 / 2|3.5| |//| divide and take the whole number (floor division) |7 // 2|3| |%| remainder (modulo) |7 % 2|1| |**| power |7 ** 2|49| -
Remember:
10 / 2→5.0(a float), not5. %is used a lot to find out whether a number is even:n % 2 == 0.//and%together: 135 minutes =135 // 60hours (2) and135 % 60minutes (15).- Precedence (order):
**first, then* / // %, then+ -. Parentheses()beat everything. It is like BODMAS. - Shortcuts:
x += 5is the same asx = x + 5. Also-=,*=,/=. +and*on strings:"ha" * 3→"hahaha".- Comparison operators return
TrueorFalse:==(equal?),!=(not equal?),<,>,<=,>=. Important:=assigns;==asks "are they equal?". - Logical operators:
A and B→Trueif both areTrue.A or B→Trueif at least one isTrue.not A→ flips it:not True→False.
- Python allows chained comparisons:
0 <= alama <= 100(alama= marks). - Floats are not 100% exact:
0.1 + 0.2→0.30000000000000004. This is normal on all computers. Useround(x, 2).
Say this to the student
- "
//and%are like sharing 17 mangoes among 5 children: each child gets17 // 5 = 3, and17 % 5 = 2are left over." - "
==is a question: 'are these two the same?' The answer is yes (True) or no (False)." - "
andis like a club bouncer saying: 'you must have a ticket and be over 18'.oris like a mother saying: 'I'll be happy if you bring bread or milk' — one is enough." - "
notis like saying 'it is not true that...'."
Type this code live (share screen)
Step 1 — hesabu.py (calculations)
a = 17 b = 5 print("a + b =", a + b) print("a - b =", a - b) print("a * b =", a * b) print("a / b =", a / b) print("a // b =", a // b) print("a % b =", a % b) print("a ** 2 =", a ** 2)
Output:
a + b = 22 a - b = 12 a * b = 85 a / b = 3.4 a // b = 3 a % b = 2 a ** 2 = 289
Step 2 — Precedence
print(2 + 3 * 4) # 14, si 20 print((2 + 3) * 4) # 20 print(2 ** 3 ** 2) # 512 (inaanza kulia: 3**2=9, 2**9=512) print(10 - 4 / 2) # 8.0
Step 3 — Real example: minutes to hours
dakika_zote = int(input("Weka dakika: ")) saa = dakika_zote // 60 dakika = dakika_zote % 60 print(dakika_zote, "dakika ni saa", saa, "na dakika", dakika)
Weka dakika: 135 135 dakika ni saa 2 na dakika 15
Step 4 — Shortcuts
salio = 10000 salio -= 2500 # umenunua vocha salio += 5000 # umepokea pesa print("Salio:", salio) # Salio: 12500
Step 5 — Comparison
x = 10 print(x == 10) # True print(x != 10) # False print(x > 3) # True print(x <= 9) # False print("a" == "A") # False (case-sensitive) alama = 75 print(0 <= alama <= 100) # True n = 8 print("Ni shufwa?", n % 2 == 0) # Ni shufwa? True
Step 6 — Logical
umri = 20 ana_kitambulisho = True print(umri >= 18 and ana_kitambulisho) # True print(umri < 18 or ana_kitambulisho) # True print(not ana_kitambulisho) # False mvua = False jua = True print("Naenda nje?", jua and not mvua) # Naenda nje? True
Write this table on the screen (truth table):
A B A and B A or B True True True True True False False True False True False True False False False False
Step 7 — Mini project: BMI (bmi.py)
# Kikokotoo cha BMI (Body Mass Index) uzito = float(input("Uzito wako (kg): ")) urefu = float(input("Urefu wako (mita, mf. 1.70): ")) bmi = uzito / urefu ** 2 print("BMI yako ni:", round(bmi, 1)) print("Uzito wa kawaida (18.5 - 24.9)?", 18.5 <= bmi <= 24.9)
Uzito wako (kg): 65 Urefu wako (mita, mf. 1.70): 1.70 BMI yako ni: 22.5 Uzito wa kawaida (18.5 - 24.9)? True
Questions to ask the student
- What does
20 / 4give? — Answer:5.0(a float). 20 % 6? — Answer:2.- How do you tell whether a number is odd? — Answer:
n % 2 == 1(orn % 2 != 0). True and False or True? — Answer:True(andhappens first:False or True→True).- The difference between
=and==? — Answer:=assigns a value;==compares and returns a bool. "5" == 5? — Answer:False— different types (str versus int).
Common mistakes
| Mistake | Error message | Fix |
|---|---|---|
| Dividing by zero | ZeroDivisionError: division by zero |
Make sure the divisor is not 0. |
= instead of == inside print |
print(x = 5) → TypeError: 'x' is an invalid keyword argument for print() (newer versions: print() got an unexpected keyword argument 'x') |
Use == to compare. |
| Forgetting to convert input | TypeError: unsupported operand type(s) for /: 'str' and 'int' |
float(input(...)). |
Expecting / to give an int |
Result is 5.0 instead of 5 |
Use // if you want an int. |
&&, ||, ! (from other languages) |
SyntaxError: invalid syntax |
Python uses and, or, not. |
| Order of calculation | uzito / urefu * urefu gives back the weight itself (uzito = weight, urefu = height) |
Use urefu ** 2 or parentheses uzito / (urefu * urefu). |
Being surprised by 0.1 + 0.2 |
0.30000000000000004 |
This is normal; use round(). |
In-class exercise
- Ask for a number of seconds (e.g. 3725), and display the hours, minutes and seconds.
- Ask for two numbers, and display whether the first is greater than the second, and whether both are positive (> 0).
- Shop price calculator: ask for an item's price and the quantity; if the total is over 50,000 the customer gets a discount — display
True/Falsefor whether they qualify, and the total after a 10% discount (for now calculatejumla * 0.9, wherejumla= total).
Answer
# zoezi 1 sekunde_zote = int(input("Sekunde: ")) saa = sekunde_zote // 3600 baki = sekunde_zote % 3600 dakika = baki // 60 sekunde = baki % 60 print(saa, "saa,", dakika, "dakika,", sekunde, "sekunde") # 3725 -> 1 saa, 2 dakika, 5 sekunde
# zoezi 2 a = float(input("Namba ya kwanza: ")) b = float(input("Namba ya pili: ")) print("Ya kwanza ni kubwa?", a > b) print("Zote ni chanya?", a > 0 and b > 0)
# zoezi 3 bei = float(input("Bei: ")) idadi = int(input("Idadi: ")) jumla = bei * idadi print("Jumla:", jumla) print("Anastahili punguzo?", jumla > 50000) print("Jumla baada ya punguzo la 10%:", jumla * 0.9)
Homework
(Session 1 homework is checked in Session 2, Session 2 homework in Session 3, and Session 3 homework in the next session.)
HW1 (after Session 1): Create shairi.py (poem) that displays one verse of a poem or song you like (4 lines), then a line of 20 * stars using print("*" * 20). Put a comment at the top.
HW2 (after Session 2): Create wasifu.py (profile) that asks for: name, age, height (metres), and whether they are a student (type "ndiyo"/"hapana", yes/no). Display each value and its type(). Then display their age in 10 years.
HW3 (after Session 3): Create kibadilishaji.py (converter): ask for an amount in Tanzanian shillings (TZS), convert it to dollars (USD) at the rate 1 USD = 2,600 TZS (use a variable KIWANGO, rate). Display the result to 2 decimal places. Also display True/False for whether the amount is enough to buy a 50-dollar item.
Answer
# shairi.py — ubeti wa shairi print("Elimu ni bahari, haina mwisho kuogelea") print("Kila siku ni safari, maarifa kujipatia") print("Usichoke kusubiri, mafanikio yatakujia") print("Python tutaijua, kwa bidii na subira") print("*" * 20)
# wasifu.py jina = input("Jina: ") umri = int(input("Umri: ")) urefu = float(input("Urefu (m): ")) jibu = input("Wewe ni mwanafunzi? (ndiyo/hapana): ") ni_mwanafunzi = jibu == "ndiyo" print(jina, type(jina)) print(umri, type(umri)) print(urefu, type(urefu)) print(ni_mwanafunzi, type(ni_mwanafunzi)) print("Baada ya miaka 10 utakuwa na miaka", umri + 10)
Remember: bool("hapana") is True (a non-empty string) — that's why we use jibu == "ndiyo". Tell the student this is a good discussion question.
# kibadilishaji.py KIWANGO = 2600 tzs = float(input("Kiasi (TZS): ")) usd = tzs / KIWANGO print("Dola:", round(usd, 2)) print("Inatosha kununua kitu cha $50?", usd >= 50)
If you are asked a question you don't know
- Say honestly: "Good question! I'm not sure — let's try it together in the REPL" (trying it often gives the answer), or "I'll look it up and bring it to you in Session 2."
- Search Google in English:
python <tatizo>(wheretatizo= the problem), e.g. "python input convert to int", or copy the last line of the error. - Official docs: https://docs.python.org/3/tutorial/introduction.html , https://docs.python.org/3/library/functions.html (print, input, int, type), https://code.visualstudio.com/docs/python/python-tutorial
End-of-week checklist
- The student has working Python 3.12+ and VS Code + the Python extension
- Can run a file with ▶ and with
python file.pyin PowerShell - Knows how to enter and exit the REPL
- Uses
print()with several items,sep,end,\n - Writes comments
# - Creates variables with correct names (snake_case)
- Distinguishes
int,float,str,booland usestype() - Knows
input()returns astrand usesint()/float() - Uses
+ - * / // % **and understands precedence - Distinguishes
=from==, and usesand,or,not - Reads error messages (the last line) without fear