Check your understanding of the previous reading: the input/processing/output cycle and the input/print functions.

Question 1

True or false: "Print is an instruction to the computer to retrieve input from the user."

Select one answer, then check.

  • Not quite. print sends information to the user, it does not retrieve anything.
  • Correct. print gives information to the user. input is the function that retrieves data from the user.

Question 2

True or false: "The console is like a chat box that you can type instructions into."

Select one answer, then check.

  • Correct. The reading calls the console "like a messenger box, for sending and receiving data to and from the computer." Later, in Interactive Evaluation, it calls the console "an interactive chat window, that you can use to communicate with the computer." That is a chat box you type into.
  • Not quite. The reading calls the console "like a messenger box, for sending and receiving data to and from the computer," and later, in Interactive Evaluation, calls it "an interactive chat window, that you can use to communicate with the computer." That is the chat box this statement describes.

Question 3

Classify each of these as either "Input" or "Output".
Typing on the keyboard
A monitor displaying information
A printer making a report
A robot moving its arm
Moving the mouse
Data being loaded from a file

Question 4

Write exactly what will be printed by running the following command:

print("Hello World!")

Show explanation

print shows the text between the quotes, without the quote marks themselves. So running this command prints Hello World! — no quotes.

Question 5

Write exactly what will be printed by running the following command (the user types 5 in the box that appears):

input("Type a number:")

Show explanation

input("Type a number:") shows the text between the parentheses as a prompt in the console. As the reading puts it, "That text will be shown as a prompt to the user in the console." So running this command prints Type a number: to the console. The answer is: Type a number: