Branching Logic with Python Conditionals - Going Beyond an Initial Python Script

preview_player
Показать описание
Branching Logic with Python Conditionals

Part of the lecture series "Going Beyond an Initial Python Script":

Full Course Website:

Notes
--------

- Conditionals let you choose which logic to run based on some logical condition
- This is just like using Excel =IF, but more flexible as we can run any arbitrary operation rather than just returning a single value
- If/else if/else pattern becomes a lot more clear in Python as they are written as separate blocks rather than a nested =IF statement in Excel
- Logical conditions are always evaluated first to True or False. If True, goes into if part, if False, goes into else part (if included)
- Be careful about single = vs double ==, it is an easy mistake to make and you will get a SyntaxError applying the incorrect one
- Elif is never strictly necessary but can help simplify the code substantially
- The lab exercises test knowledge of conditionals but also build on our prior knowledge of for loops and show how they can be combined

Resources
------------

Рекомендации по теме
Комментарии
Автор

Thank you so much NIck. I have learnt so much on python programming from your videos... Best Tutor

normangabu
welcome to shbcf.ru