← Back to the Introduction to Computer Science outline The Course Maker
← Introduction to Computer Science outline
Week 3 · Module overview

Week 3 — Input, Output & Strings

Introduction to Computer Science Free sample edition

Welcome to your Week 3 Start Here page.

Why this matters

A nursing student typing a temperature reading into a chart form and a business major building a receipt line both depend on a program treating typed text as text and converting it on purpose.

In plain language

Most programs you use talk with a person: they ask a question, wait for an answer, and reply. This week your programs do that too. You will use input() (Python's way of asking the person at the keyboard to type something) and learn that whatever comes back is text, even when the person types digits. You will build replies with f-strings (strings that fill in values for you), and you will take text apart one character (one letter, digit, space, or mark) at a time or one piece at a time. As always, you predict what each line prints and then run it to check.

  • Already covered: Week 1's predict-then-run habit and Week 2's types and conversions.
  • This week: input(), f-strings, indexing, slicing, len(), and the IndexError.
  • How they connect: every typed value is a str, so Week 2's int() becomes an everyday tool.
  • Where we're going next: Week 4, Booleans & Conditionals.

Focus

How does a program ask a person for a value, reply with a sentence, and take text apart?

By the end of this module, you should be able to:

  • [ ] convert typed digits with int() before arithmetic
  • [ ] build an output line with an f-string
  • [ ] predict what an index or a slice of a string prints

To-do

Plan your week

  1. Read Chapter 3 (about 40 minutes), then the lecture and slides.
  2. Work the lecture tutorial (60–90 minutes) and the practice set (about 20 minutes).
  3. Do the Coding Lab (about 90 minutes), the discussion, and the assignment.
  4. Take the quiz.

This week's checkpoint: predict what a slice of a string prints, run it, and say which index it left out.

You've got this

Predict, then run, and ask your instructor if a step snags.

Built with The Course Maker · samples.thecoursemaker.com