Uploaded June 2021 | Updated November 2026, 3 hours ago
This is the fifth in a course of computer science video lessons introducing programming with Python. It shows you how to use the If statement to execute a block of code, or not, depending on the contents of a variable. You will also see how an If statement can include several elif clauses, plus a final else clause, to execute one block of code only, depending on a group of several related tests. You will learn about the importance of correct indentation when defining blocks of code for an If statement. You will also see how Python uses two equal signs to test for equality. You will see a program that allows the user to enter a country, and outputs a country specific greeting.
This is the fifth in a course of computer science video lessons introducing programming with Python. It shows you how to use the If statement to execute a block of code, or not, depending on the contents of a variable. You will also see how an If statement can include several elif clauses, plus a final else clause, to execute one block of code only, depending on a group of several related tests. You will learn about the importance of correct indentation when defining blocks of code for an If statement. You will also see how Python uses two equal signs to test for equality. You will see a program that allows the user to enter a country, and outputs a country specific greeting.










