>>> l = [22, 13, 45, 50, 98, 69, 43, 44, 1] >>> [x+1 if x >= 45 else x+5 for x in l] [27, 18, 46, 51, 99, 70, 48, 49, 6]
Do-something if <condition>, else do-something else.
<condition>
1.4m articles
1.4m replys
5 comments
57.0k users