Notes on Python & Computational Thinking
Exploring the following
Operators and operands - building expressions, statements, key building blocks for writing code. Simple sets of programs: branching, conditionals and iterations.
Representations of fundamental data. Ways to give instructions to manipulate that data, giving the description of the ‘recipe’.
There are three types of primitive data.
Numbers
Strings
and Boolean
Associated with every primitive value is a type. Numbers are represented as integers and floats.
We combine things with expressions. Expressions are formed with operands and operators. Expressions are typed into the interpreter - which is Python. The interpreter is a program inside of the machine which is following the rules to deduce the value we print out.
It evaluates and then it prints. Expressions mostly happen within code, within a script. The evaluator (a questionably legit word) will determine the value from those expressions but it won’t be printed, why? Because typically this is for later use and is stored in a variable in a data structure.
In the code or script, there’s no print unless we make it explicit.
Simple example:
syntactical form = number + operand + expression
number + multiplication in a string = new string with concatenation
two strings added together = concatenation of the two
Type checking is one of the most important things. It identifies weak to strong type and encourages you to use a ‘clean code’ or good code hygiene. Keeping the code neat means python (and you) could easily identify syntax errors in later on.
















