Turn inputs into useful values
Distinguish text from numbers and trace named values through a small calculation.
In this lesson
- It starts with a question. Will a quantity typed into a form automatically be a number?
- The idea you will find. A name holds a value; its type affects what operations mean. — A number can take part in arithmetic. A string is text: combining the strings "3" and "4" produces "34", while adding the numbers 3 and 4 produces 7. Convert only after checking that the input represents an allowed number.
- How you learn it. By doing: a number line, matching.
- Length. 8 short steps. Progress saves on this phone.
Part of Python market notebook
Follow a fictional market notebook through inputs, totals, data structures and tested functions. Complete every activity inside FijiLearn.