From the course: Python for JavaScript Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Control flow in Python

Control flow in Python - Python Tutorial

From the course: Python for JavaScript Developers

Start my 1-month free trial

Control flow in Python

- [Instructor] Control flow in Python is very similar to plain English, so much so that sometimes you can actually use common sense to figure out its syntax. In order to see that, let's have a look at some common operators. So in Python, you'll see that the or operator is simply the English word or. So a or b is just a or b. Similarly, the and operator is the word and. So a and b. For showing if something is equal, we usually do double equals as opposed to triple equals. So a equals b would be a equals equals b. Stricter comparisons that are less commonly used are a is b. Then for not equal, we do exclamation mark followed by equal as opposed to explanation mark followed by two equals in modern JavaScript. And then for assessing that something is false, instead of doing exclamation mark a, we would say not a. So if we wanted to see if a was a non-value, we could say, if not a. Similarly, if a were false,…

Contents