|
| 1 | +# Hints |
| 2 | + |
| 3 | +## General |
| 4 | + |
| 5 | +- The Python Docs on [Control Flow Tools][control flow tools] and the Real Python tutorial on [conditionals][real python conditionals] are great places to start. |
| 6 | +- The Python Docs on [Boolean Operations][boolean operations] can be a great refresher on `bools`, as can the Real Python tutorial on [booleans][python booleans]. |
| 7 | +- The Python Docs on [Comparisons][comparisons] and [comparisons examples][python comparisons examples] can be a great refresher for comparisons. |
| 8 | + |
| 9 | +## 1. Check for criticality |
| 10 | + |
| 11 | +- Comparison operators and boolean operations can be combined and used with conditionals. |
| 12 | +- Conditional expressions must evaluate to `True` or `False`. |
| 13 | +- `else` can be used for a code block that will execute when a conditional test returns `False`. |
| 14 | + |
| 15 | + ```python |
| 16 | + >>> item = 'blue' |
| 17 | + >>> item_2 = 'green' |
| 18 | + |
| 19 | + >>> if len(item) >=3 and len(item_2) < 5: |
| 20 | + print('Both pass the test!') |
| 21 | + elif len(item) >=3 or len(item_2) < 5: |
| 22 | + print('One passes the test!') |
| 23 | + else: |
| 24 | + print('None pass the test!') |
| 25 | + ... |
| 26 | + One passes the test! |
| 27 | + ``` |
| 28 | + |
| 29 | +## 2. Determine the Power output range |
| 30 | + |
| 31 | +- Comparison operators can be combined and used with conditionals. |
| 32 | +- Any number of `elif` statements can be used as "branches". |
| 33 | +- Each "branch" can have a separate `return` |
| 34 | + |
| 35 | +## 3. Fail Safe Mechanism |
| 36 | + |
| 37 | +- Comparison operators can be combined and used with conditionals. |
| 38 | +- Any number of `elif` statements can be used as "branches". |
| 39 | +- Each "branch" can have a separate `return` |
| 40 | + |
| 41 | + |
| 42 | +[python comparisons examples]: https://www.tutorialspoint.com/python/comparison_operators_example.htm |
| 43 | +[boolean operations]: https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not |
| 44 | +[comparisons]: https://docs.python.org/3/library/stdtypes.html#comparisons |
| 45 | +[python booleans]: https://realpython.com/python-boolean/ |
| 46 | +[real python conditionals]: https://realpython.com/python-conditional-statements/ |
| 47 | +[control flow tools]: https://docs.python.org/3/tutorial/controlflow.html |
| 48 | + |
0 commit comments