Input

Computer Science: KS3, topic 2.3.2

Input

There must be some mechanism for the user to input data to the computer.

What data can I input?

What data can I input?

  • Data can be input from any device connected to the computer.
  • The keyboard is the most common data input device for command line programs.
  • We will only look at keyboard input in this course.
The input function

The input function

  • Python has a built in function (command) which allows us to take keyboard input.
  • We can use the code: input(“Prompt”) to take the input.
  • We can write any text for the “Prompt”, which will be displayed to the user before they type their response.
Data type of input

Data type of input

  • When data is entered from the keyboard, it is automatically a ‘string’.
  • A string is a sequence of character inputs from the keyboard, for example ‘Hello’.

Test yourself on Input

  • What is the most common input device for command line programs?

  • What data type is keyboard input?

  • Data can only be input from a keyboard. True or false?

Practise this topic for free