Part 5 of 12 : Variables
(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?
(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.
- If you have any questions or comments about the material please PM me and I’ll be happy to answer.
- If you’re unsure about any of the technical terms there are definitions on this page: