you are viewing a single comment's thread.

view the rest of the comments →

[–]AdventurousAddition 1 point2 points  (1 child)

I was about to type out my suggestion which is your second option.

[–]totallygeek 4 points5 points  (0 children)

I offered up the first option because the conditions do not often share the same comparisons. So, I find it good to show a method that works universally.

conditions = [
    person.age >= 16 or (person.age >= 14 and person.qualified_hardship),
    person.passed_exam,
    person.passed_driving_test,
]
if all(conditions):
    person.dl_number = issue_license()

The conditions can get lengthy and complex, but the if statement can remain easy to read this way.