Skip to content
Menu

Year 7 · Computing · Python: first programs · Lesson 2

Variables and input

Python variables and assignment, getting user input with input(), changing a variable's value, and the rules for naming variables.

Whiteboard video lesson: Variables and input

17-minute video lesson

Teaching, worked examples and 20 practice questions solved step by step.

Watch free for a month

What your child will learn

  • Create and use variables
  • Get user input
  • Predict output with variables
  • Choose valid, meaningful names

The method

  1. Name.
  2. Store.
  3. Use (no quotes).
  4. Check case.

Key words: variable, assignment, input, prompt, value, case-sensitive.

Worked examples

The first three practice questions from the lesson, with every step.

Question 1

What is a variable?

  1. Step 1: Box

Answer: a named place that stores data

Question 2

What does = do in Python?

  1. Step 1: Store

Answer: assigns (stores) a value in a variable

Question 3

What does input() do?

  1. Step 1: Ask

Answer: asks the user to type something