Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python convert list to true falsebased on condition

# Basic syntax:
boolean_list = [True if x == 'condition' else False for x in your_list]
# This converts a list to True/False based on the condition specified
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #convert #list #true #falsebased #condition
ADD COMMENT
Topic
Name
8+8 =