A simple sample program. I want to know if the "in" keyword makes the program of O(n) complexity when used here.
dummyList = [1, 4, 8, 7, 2]
num = 5
if num in dummyList:
print("found")
A simple sample program. I want to know if the "in" keyword makes the program of O(n) complexity when used here.
dummyList = [1, 4, 8, 7, 2]
num = 5
if num in dummyList:
print("found")