Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

#check if the element exists in the list.#check if the element exists in the list.

#check if the element exists in the list.
l1 = ['sanjose', 'cupertino', 'sunnyvale', 'fremont']
if 'sanjose' in l1:
#Returns True
  print('True')
else:
  print('False')
if 'paloalto' in l1:
#returns False
  print('True')
else:
  print('False')
 
PREVIOUS NEXT
Tagged: #element #exists #element #exists
ADD COMMENT
Topic
Name
2+7 =