Quiz — Lecture 04

Section A from memory, one line each. Section B shows your reasoning - marks are for method, not final answers. Answers are discussed in class; the exit ticket goes on a card.

Section A

A1. What type does input() return in Python?

A2. What is the difference between = and == ?

A3. What is 'state' in a running program?

A4. print writes a value for humans; what does return do?

Section B

B1. Translate the echo-with-limits pseudocode into Python, keeping the skip counter.

B2. The change maker: amount 87 with coins 25/10/5/1 - write the loop using // and %, and give the output.

Exit ticket

Answer one of these on your card in 60 seconds (choose any one):

  1. What does predict-then-run change about learning?
  1. Name the three Python errors you met today and their causes.
  1. Why convert input strings before arithmetic?

Homework