Mimic the FirstOrDefault from LINQ in Python.

FirstOrDefault in Python.

Learn how to perform a FirstOrDefault that you know from C# in Python. In this video you learn how to use a generator expression and the next function to mimic the FirstOrDefault from LINQ.

Written by Loek van den Ouweland on 2020-04-16.
Questions regarding this artice? You can send them to the address below.