Back to Lesson

Batch Validation

Use any() and all() to evaluate system state rules.

Instructions

  • Given a list of user statuses:
    flags = [True, True, False, True, True]
  • Use
    all()
    to check if everyone is active. Print the result.
  • Verify if offline users exist. Use
    any()
    on a list mapping the False elements (e.g.,
    [not f for f in flags]
    ). Print this result.
main.py
main.py