Check your understanding of the previous reading on values.

Question 1

True or false: the purpose of a value is to represent data from the real world.

Select one answer, then check.

  • Correct. The reading opens with exactly this idea: "we use values to represent the real world as data in the computer."
  • Not quite. Representing real-world data is exactly why we use values.

Question 2

True or false: the print instruction can only print literal values.

Select one answer, then check.

  • Not quite. print can print any value, not just ones written literally in the code.
  • Correct. print works on any value, whether it is a literal written directly in the code or a value that came from somewhere else (a variable, an expression, user input, ...).

Question 3

True or false: literal values are specific values written in the source code.

Select one answer, then check.

  • Correct. As the reading puts it: "When we write values directly in code, we call them 'Literal Values' ... The values are literally written there in the code."
  • Not quite. That is precisely the definition of a literal value used in the reading.

Question 4

What does the following value specifically represent? 24

Select one answer, then check.

  • Not quite. This is a plausible story for 24, but nothing in the value itself tells you this is what it represents.
  • Correct. This is the reading's core point in "Understanding Values": a bare value like 24 has no meaning on its own. It could represent hours in a day, someone's age, a quantity, or countless other things - we need more context to know which.
  • Not quite. Also a plausible story, but the value 24 alone does not tell you this is what it means.
  • Not quite. 24 is coincidentally also the name of a TV show, but nothing marks the value as representing that rather than anything else.

Question 5

Which of the following could be represented with a value?

Select every option that could be represented with a value, then check.

  • Yes. A height is a measurable quantity, like the distances and temperatures the reading gives as examples - it fits naturally as a number.
  • Yes. The reading says values can represent "even the text of entire books" - an entire novel's text is a value too, just a very long string.
  • Yes. This is a concrete count, an integer, similar to the reading's own examples like someone's age.
  • Yes. This is a text description, which is text. The reading itself says values can represent "even the text of entire books," so a written description fits the same way.
  • Marked as not fitting this lesson's notion of a value. An audio recording is binary/file data, not one of the basic literal types this lesson covers (numbers, strings, booleans, None) - it does not fit alongside the reading's examples the way a measurement or a name does.