DEV Community

Discussion on: 6 Nifty Python Language Features You Might Not Know About

Collapse
 
md2perpe profile image
Per Persson

And instead of

if all([subject_marks > passing_marks for subject_marks in marks]):
    promoted = True
else:
    promoted = False
Enter fullscreen mode Exit fullscreen mode

we just write

promoted = all([subject_marks > passing_marks for subject_marks in marks])
Enter fullscreen mode Exit fullscreen mode
Collapse
 
bikramjeetsingh profile image
Bikramjeet Singh

Good catch! Can't believe I missed that.