2.3.2

Input

Test yourself

Input

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

Illustrative background for What data can I input?Illustrative background for What data can I input? ?? "content

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.
Illustrative background for The input functionIllustrative background for The input function ?? "content

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.
Illustrative background for Data type of inputIllustrative background for Data type of input ?? "content

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’.

Jump to other topics

1Computational Thinking & Algorithms

2Programming

3Hardware & Software

4Data

5The Internet

6Online Safety & Security

Unlock your full potential with Seneca Premium

  • Unlimited access to 10,000+ open-ended exam questions

  • Mini-mock exams based on your study history

  • Unlock 800+ premium courses & e-books

Get started with Seneca Premium