Answers for "python match one list to another"

2

list of lists to single list python

flat_list = [item for sublist in t for item in sublist]
Posted by: Guest on August-03-2021
0

find element from one list in another python

myList = ['computer', 'programming', 'hello', 'world']
query = ['hello', 'world']

# iterate through the smallest list so it takes less time
for eachQ in query:
	if eachQ in myList:
      print("True, query found at index " + str(myList.index(eachQ)))
    else:
      print("False")
Posted by: Guest on April-18-2022

Code answers related to "python match one list to another"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language