filmov
tv
Python Tutorial v3.2.5 Lesson 17.1 - Introduction to the elif/else Statement

Показать описание
2:42 Skip the introduction for Lesson 17.1
7:33 Skip directly to the inclusion of elif statements.
15:32 Skip directly to the inclusion of an else statement.
Lesson 17.1 introduces the the elif and else statements to be used with if statements from earlier lessons. The main difference between using an elif statement and multiple if statements is that only a single if/elif/else statement will execute (the first to be found True) whereas all True statements in a series of if checks will be executed. This can cause some bugs in your program if used improperly as shown in the examples in this lesson.
This is an introductory series of Python tutorials. This course, from start to finish, is designed to help someone who has never programmed before learn the basics of coding in Python. As this series continues, we examine more advanced Python techniques, functions, and methods.
Keep in mind this tutorial is using an older version of Python, v3.2.5. You will need to click on the "View Older Releases" button to use this specific version. Using the newer versions will not be an issue at this point, but when the lesson proceeds to basic graphics, the Pygame Module we'll use does not support v3.3+ at this time.
7:33 Skip directly to the inclusion of elif statements.
15:32 Skip directly to the inclusion of an else statement.
Lesson 17.1 introduces the the elif and else statements to be used with if statements from earlier lessons. The main difference between using an elif statement and multiple if statements is that only a single if/elif/else statement will execute (the first to be found True) whereas all True statements in a series of if checks will be executed. This can cause some bugs in your program if used improperly as shown in the examples in this lesson.
This is an introductory series of Python tutorials. This course, from start to finish, is designed to help someone who has never programmed before learn the basics of coding in Python. As this series continues, we examine more advanced Python techniques, functions, and methods.
Keep in mind this tutorial is using an older version of Python, v3.2.5. You will need to click on the "View Older Releases" button to use this specific version. Using the newer versions will not be an issue at this point, but when the lesson proceeds to basic graphics, the Pygame Module we'll use does not support v3.3+ at this time.