Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

try except in list comprehension

# Python List Comprehension Error Handling:
# The correct responses to the question "how to handle exceptions in a list 
# comprehension" are all expressing part of all of this truth: 1) literally, 
# i.e. lexically IN the comprehension itself, you can't; 2) practically, you 
# delegate the job to a function or check for error prone values when that's 
# feasible.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #list #comprehension
ADD COMMENT
Topic
Name
9+4 =