Comparison and Logical Operators
Learn how to compare values.
Comparison and logical operators
We know how to use built-in functions as well as define our own functions. We also know how to take input from the user and assign it to a variable for storage (and reuse) or pass it as further input to a function. We also know how to output something on the screen for the user. But we can only write sequential programs, where the computer fetches and executes one line of our code after another, from the first executable line to the last, in a strictly sequential order.
This equips us with the necessary skills to solve a lot of interesting problems, but there are still some problems that sequential programs cannot solve. Sometimes, a solution might require non-sequential execution as well:
This chapter is about learning how to write programs that can, while they are executing, be selective about executing lines of code. Secondly, we will learn to write programs that can execute some lines of our code multiple times. Our project will require us to be able to code this way. ...