Back to the Introduction to Computer Science outline The Course Maker
Introduction to Computer Science outline
Week 2 · Readings & resources

Week 2 — Readings & Resources · Variables, Data Types & Expressions

Introduction to Computer Science · CSCI 1101 Fall 2026 · Prof. Okafor Fictional sample

Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective covered: Objective 2 — Use variables, the core data types, and expressions; trace and debug what they produce.


How to use this page

Everything here is a link to an external resource — open it in your browser. Nothing needs to be downloaded or installed; the Python environments below run in the browser.

This week's load is still light: read two short pages and run their examples. The fastest way to learn variables and the division operators is not to read about them — it's to type them and run them. Keep your online Python editor open the whole time.

Order that matches the lecture: ① variables & the four types → ② operators & precedence (/ vs // vs %) → ③ type conversion → ④ the official "Python as a calculator" reference.

A habit to keep: never trust an output you didn't run. Before you believe what a page (or a chatbot) says 10 / 2 prints, paste it into the runner and run it yourself. (Spoiler: 5.0.)


① Variables & the Four Core Types

Maps to Lecture Segment 2. A variable is a named box; = stores a value; every value has a type (int, float, str, bool), and type() tells you which.

Read & do — "Python Variables and Literals" (Programiz)
🔗 https://www.programiz.com/python-programming/variables-constants-literals
Why it's assigned: the cleanest walk-through of storing a value with =, changing a variable's value (reassignment), and the boolean literal True/False — exactly the box-and-value picture from class. Read it, then type a couple of the examples and run them.
⏱ ~8 min

Reference — your tools (open these; you'll use them every week)
🔗 https://www.online-python.com/ — write and run code (a second option: 🔗 https://www.programiz.com/python-programming/online-compiler)
🔗 https://pythontutor.com/watch a variable change step by step (paste a program, click Visualize Execution, step forward)
Why they earn the click: this week, Python Tutor is the star — you can literally see a box's value update when you reassign it.
⏱ 2 min to open


② Operators, Precedence & the Division Trio

Maps to Lecture Segments 3–4. Operator precedence; and the three divisions: / (always a float), // (floor), % (remainder), plus ** (power).

Read & do — "Python Operators" (Programiz)
🔗 https://www.programiz.com/python-programming/operators
Why it's assigned: a clear table of the arithmetic operators with worked examples — including //, %, and **. Focus on the Arithmetic Operators section. Then run print(7 / 2), print(7 // 2), and print(7 % 2) yourself and watch how they differ.
⏱ ~8 min

Reference (optional) — "Precedence and Associativity of Operators in Python" (Programiz)
🔗 https://www.programiz.com/python-programming/precedence-associativity
Why it earns the click: if the order-of-operations rule is fuzzy, this is the full table of what binds tighter than what. Skim it; you only need the arithmetic rows for now.
⏱ ~4 min


③ Type Conversion (int(), float(), str())

Maps to Lecture Segment 5. Convert a value's type so "5" + 3 becomes int("5") + 3.

Read & do — "Python Type Conversion" (Programiz)
🔗 https://www.programiz.com/python-programming/type-conversion-and-casting
Why it's assigned: it shows exactly the '12' + 23 situation from class — why it fails, and how int(...) fixes it — with the type() output before and after. Read it, then reproduce the fix in your editor.
⏱ ~6 min


④ The Official Reference

Maps to Lecture Segments 3–5. The source of truth on numbers, / returning a float, //, %, **, and assignment.

Read — "An Informal Introduction to Python" (official Python Tutorial, §3)
🔗 https://docs.python.org/3/tutorial/introduction.html
Why it's assigned: the official docs show Python "as a calculator" and state it plainly — "division (/) always returns a float" — with 17 // 3, 17 % 3, and 5 ** 2 worked out, plus the NameError you get from using a variable before assigning it. Skim §3.1.1 (Numbers). (The whole tutorial starts here: 🔗 https://docs.python.org/3/tutorial/index.html — your reference all term.)
⏱ ~8 min


Optional one-stop references (free online)


Pick-one quick path (≈15 min total)

In a hurry? Do exactly these two and you'll be ready for the quiz:
1. Read "Python Variables and Literals" on Programiz and run two of its examples (group ①).
2. Read the Arithmetic Operators section of "Python Operators," then run print(10 / 2), print(7 // 2), and print(7 % 2) in the editor and see for yourself that / makes a decimal (groups ②).

Heads-up (links rot): these point to outside sites that occasionally move or rename pages. If a link ever fails, tell Prof. Okafor and use the official Python Tutorial (docs.python.org/3/tutorial) or W3Schools (w3schools.com/python) in the meantime.

~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com