exercism.org/python/meltdown-mitigation/HINTS.md

2.2 KiB

Hints

General

1. Check for criticality

  • Comparison operators (comparisons) and boolean operations (concept:python/bools) can be combined and used with conditionals.

  • Conditional expressions must evaluate to True or False.

  • else can be used for a code block that will execute when all conditional tests return False.

       >>> item = 'blue'
       >>> item_2 = 'green'
    
       >>>  if len(item) >= 3 and len(item_2) < 5:
              print('Both pass the test!')
            elif len(item) >= 3 or len(item_2) < 5:
              print('One passes the test!')
            else:
              print('None pass the test!')
      ...
      One passes the test!
    

2. Determine the Power output range

  • Comparison operators can be combined and used with conditionals.
  • Any number of elif statements can be used as decision "branches".
  • Each "branch" can have a separate return

3. Fail Safe Mechanism

  • Comparison operators can be combined and used with conditionals.
  • Any number of elif statements can be used as decision "branches".
  • Each "branch" can have a separate return