📜  python first - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:16.620000             🧑  作者: Mango

代码示例1
# find first item to match condition
# with error if not found
next((x for x in the_iterable if x > 3))
# .. or provide default value if not found
next((x for x in the_iterable if x > 3), default_value)