There are two steps to writing a program: converting your problem into a step-by-step algorithm that your computer can digest, and then implementing this in your favourite programming language (python). Once you've set up your problem as an algorithm, you've written a program. The rest is syntax.
As an example, how would you tell a robot to make tea?
This example depends strongly on your tea-making philosophy. Do you add milk? Before or after the hot water?
Going back to TipCalculator, the algorithm we've used is as follows
Odds are, as a scientist, you won't be programming many futuristic household appliances or rehashing old apps. What about finding the factorial of a positive integer?
As an exercise, write an algorithm to generate the Fibonacci sequence.