Answers for "#check if the element exists in the list.#check if the element exists in the list."

0

#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')
Posted by: Guest on March-26-2022

Code answers related to "#check if the element exists in the list.#check if the element exists in the list."

Python Answers by Framework

Browse Popular Code Answers by Language