AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    Input/output: Be able to obtain user input from the keyboard.

    Keyboard input means a running program pauses, waits for the user to type characters and press Enter, then stores what was typed in a variable so later code can use it.

    Checked against the AQA 8525 specification (opens in a new tab) on .

    • Point 1 of 2

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    Keyboard input means a running program pauses, waits for the user to type characters and press Enter, then stores what was typed in a variable so later code can use it. In Python, input() returns a string; to do arithmetic you must convert it, for example age = int(input("Age? ")). In pseudocode, write INPUT name or name = USERINPUT. The prompt text is a courtesy to the user, not the data itself. A common method is: display a prompt, read the line, convert to the required data type, then validate. Assessment asks you to recognise correct input statements, predict stored values and spot type errors, such as comparing a string with a number.

    What earns the marks

    • Identifies that keyboard input requires the program to wait for the user to type and confirm entry (usually Enter).
    • Recognises that the entered characters are stored in a named variable for later use.
    • States that input is normally captured as text (a string) and must be converted, e.g. int() or float(), before numeric use.
    • Distinguishes the prompt message shown to the user from the value actually stored.
    • Selects the correct input statement or predicts the value held after a given input line executes.

    Common mistakes and how to put them right

    • Assuming input() automatically produces a number.

      Put it right: Is that it returns a string, so conversion such as int() is needed for arithmetic.

    • Confusing the prompt text with the stored value.

      Put it right: Is that the prompt is displayed, while the typed response is what the variable holds.

    • Thinking input happens without the user acting.

      Put it right: Is that the program pauses until the user types and confirms.

    Exam tips

    • Read the whole line of code and note which variable receives the value.
    • Check the data type: if arithmetic follows, look for a conversion function.
    • When predicting output, separate what is displayed (the prompt) from what is stored.

    Try the lesson

    The start of the Input/output: Be able to obtain user input from the keyboard. lesson, made from checked teaching notes for this specification point.

    Have a go first

    In a Python program, which statement pauses the program and waits for the user to type something on the keyboard?

    There is more to this lesson

    The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Input/output: Be able to obtain user input from the keyboard.

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge