Python: How to get the first found element in a list or None

To get the first element found in a list by some condition or None if nothing was found we can use the following construction:

With nothing found it returns None:

 

0 0 votes
Article Rating
Subscribe
Notify of
0 Комментарий
Newest
Oldest Most Voted
Inline Feedbacks
View all comments