Part 5

Part 5 of 12 : Variables

1 Reading
https://logicengineers.com/print-feck-the-world/5-variables/

2 Questions
(a) What is the purpose of a variable?
(b) Name 3 different types of variables.
(c) What is the technical term for each item in a list?
(d) If you have a list within another list, what is this called?

3 Exercises
(a) Follow the instructions in this part and type the programs into your editor, then run them to see the results.
(b) Choose a book anyone will do, and create a list with the following information about that book:

  • a string variable for holding the title
  • a string variable for holding the author
  • an integer variable (whole number) for holding the year it was published.
  • a float variable (fractional number) for holding the price.
  • a boolean variable to indicate whether or not there’s an ebook version.

(c) Print on screen the list you created in the last exercise.