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

Week 3 — Readings & Resources · Input / Output & Strings

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, data types, expressions, and input/output — read input with input(), build output with f-strings, and work with strings (indexing, slicing, len).


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 light, but do it with the editor open. The single fastest way to learn slicing is to type a slice and run it — your gut will be wrong about the exclusive stop until you've seen Python prove it a few times. So keep the runner open and test every slice you read about.

Order that matches the lecture: ① read input with input() → ② build output with f-strings → ③ index & slice strings (watch the exclusive stop) → ④ len, and reading an IndexError.

A habit to keep: never trust an output you didn't run. Before you believe what a page (or a chatbot) says "PYTHON"[1:4] prints, paste it into the runner and run it yourself. (It's YTH.)


① Read Input — input() and the "always a string" rule

Maps to Lecture Segment 2. input() pauses the program, reads what the user types, and always returns a string — convert with int() to do math.

Read & do — "Python Basic Input and Output" (Programiz)
🔗 https://www.programiz.com/python-programming/input-output-import
Why it's assigned: the cleanest walk-through of input() and print() — it shows directly that input() returns a string and demonstrates converting it with int(...), which is exactly this week's classic bug and its fix. Read it, then run x = input(); print(type(x)) in the editor and watch it say str.
⏱ ~8 min

Read — "Input and Output" (official Python Tutorial, §7)
🔗 https://docs.python.org/3/tutorial/inputoutput.html
Why it's assigned: the source-of-truth on formatted output — skim the "Formatted String Literals" (f-strings) section to see f"..." with { } placeholders done the official way. This is the reference you'll return to whenever you format output.
⏱ ~8 min


② Build Output — f-strings and string basics

Maps to Lecture Segment 3. Put an f before the quote and drop a variable into { }; Python substitutes its value.

Read & do — "Python f-Strings" (Programiz)
🔗 https://www.programiz.com/python-programming/fstring
Why it earns the click: short, practical, and entirely about f-strings — f"{name}", dropping in numbers, and basic formatting. Type the examples and run them; from this week on, f-strings are our default way to build output.
⏱ ~6 min


③ Index & Slice Strings · and ④ len + IndexError

Maps to Lecture Segments 4–5. A string is a sequence of characters; s[0] / s[-1] index, s[1:4] slices (stop excluded), len(s) measures, and going past the end raises an IndexError.

Read & do — "Python Strings" (Programiz)
🔗 https://www.programiz.com/python-programming/string
Why it's assigned: the most complete single page for this week — it covers indexing, negative indexing, slicing, len(), concatenation with +, and f-strings with runnable examples, and it explicitly notes that an out-of-range index raises an error. Read it with the editor open and run every slice.
⏱ ~12 min

Read — "An Informal Introduction to Python" → §3.1.2 Text (official Python Tutorial)
🔗 https://docs.python.org/3/tutorial/introduction.html
Why it's assigned: the official docs lay out indexing, negative indices, and slicing with the famous word = 'Python' example and the index ruler — including the line that says it all: "the start is always included, and the end always excluded." It also shows the exact IndexError: string index out of range you'll meet in class. Read §3.1.2 (Text).
⏱ ~10 min

Reference (skim now, bookmark for later) — "Python Strings" (W3Schools)
🔗 https://www.w3schools.com/python/python_strings.asp
Why it earns the click: a friendly, example-first reference with a green "Try it Yourself" button on every snippet, so you can run slicing and f-string examples right on the page. Great for a quick second explanation when something hasn't clicked.
⏱ ~8 min


Optional one-stop references (free online)

  • Run Python in your browser — a free online editor (no install). This is "the runner" referenced above — type a slice, press Run, read the output. Keep it open all week.
    🔗 https://www.online-python.com/
  • Python Tutor — see a slice run, step by step. Paste s = "PYTHON" and a print(s[1:4]), click Visualize Execution, and step forward to watch indexing happen.
    🔗 https://pythontutor.com/
  • Programiz — "Getting Started with Python" (full Python tutorial index). A free, well-organized tutorial you can return to all term; it covers every topic in this course in order.
    🔗 https://www.programiz.com/python-programming

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 Basic Input and Output" on Programiz, then run x = input(); print(type(x)) and watch it print str (group ①).
2. Read §3.1.2 (Text) in the official tutorial, then in the editor run s = "PYTHON" followed by print(s[1:4]), print(s[-1]), and print(s[::2]) and see what they actually print — YTH, N, PTO (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