Programming in Python: Data, Variables and Errors - Cambridge Lower Secondary Class 7 Computing Notes, Diagrams and Solved Questions
Write text-based Python programs that take input, store it in variables of the right data type (integer, real or string), calculate with +, −, * and /, and print the result, then find and fix syntax, runtime and logic errors.
In this chapter
Text-based programs and output with print()
Variables and assignment, shown as boxes in memory
Data types: integer, real (float) and string
Input with input(), and converting with int() and float()
Arithmetic operators and the order of operations
How syntax, runtime and logic errors get into programs
Debugging systematically with tests and trace tables