Conditional List - All
You can use 'all' method on a list to check if all 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
score=325
wickets=7
catch=4
list_cond=[score>320,
           wickets<8,
           catch>3]
if(all(list_cond)):
    print("All true")
else:
    print("All not true")
Copy | Download as: .py file   PNG
Share on: FB   Twitter   LinkedIn   WA
©2021 - code108labs   Contributors   Hosted on DigitalOcean   Partner website: pythoncircle.com