tuple
and list
both have constant time O(1)
for searching an element, but is it a different constant time for each?
Let's say I have two variables
list1 = ["hello", "how", "are", "you"]
tuple1 = ("hello", "how", "are", "you")
Is there a different constant time for searching in lists:
if "you" in list1:
print "Found"
vs. tuples:
if "you" in tuple1:
print "found"