Conditional List - Any
You can use 'any' method on a list to check if any of the conditions in that list evaluates to True
Python: 3.0    Anurag Rana    16 Jul 2021   0
Login to upvote
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
score=200
wickets=7
catch=4

list_cond=[score>320,
           wickets<8,
           catch>3]

if(any(list_cond)):
    print("at least one of the condition is true")
else:
    print("None of the condition is true")
Copy | Download as: .py file   PNG
Share on: FB   Twitter   LinkedIn   WA
©2021 - code108labs   Contributors   Hosted on DigitalOcean   Partner website: pythoncircle.com