The idea
Python values have types, including integers, floats, strings, booleans and lists. A variable name refers to a value, and assigning a new value can change that reference. Input read from a user is commonly text and needs explicit validation before numeric calculation. Type conversion can fail; handle invalid input rather than assuming every string contains a valid number.
Worked example
The expression 10 + 5 gives 15, while '10' + '5' gives the string '105'. The list prices = [10, 20, 30] holds three ordered values; prices[0] is 10 because indexing starts at zero. Trying to read prices[3] fails because the fourth element does not exist.
Try it
Write down the types and results of 2 + 3, '2' + '3' and int('2') + 3. Create a three-item list and identify its first and last valid indexes. Explain what should happen if someone types a word where your program expects a whole-number quantity.
