In this example we will show how to determine if a specified item is present in a tuple in Python.
Source Code
my_tuple = ('a', 'b', 'c', 'd')
if 'c' in my_tuple:
print("'c' is in the tuple.")
Output:
'c' is in the tuple.
In this example we will show how to determine if a specified item is present in a tuple in Python.
my_tuple = ('a', 'b', 'c', 'd')
if 'c' in my_tuple:
print("'c' is in the tuple.")
Output:
'c' is in the tuple.