-
Book Overview & Buying
-
Table Of Contents
Applied Computational Thinking with Python - Second Edition
By :
As previously mentioned throughout this chapter, an algorithm is a set of instructions. When we are writing a computer program, an algorithm is a set of instructions given to the computer so it can provide a solution to a posted problem. We have been sticking to mathematical algorithms so far only because we haven’t done a deeper dive into Python yet. However, we will now translate some of the algorithms into Python programming.
First, let’s take a look at Problem 1. Here, we had a situation where you could win $250 or your height in quarters. Assuming it is you who’s competing, you would want to know which option gives you the most in winnings.
Let’s take a look again at our mathematical algorithms from earlier in this chapter:
Remember, if you...