💵
Should I be buying I-Bonds in 2022?
Should I be buying I-Bonds in 2022?
💰
Need a step-by-step guide to opening your Roth IRA?
Need a step-by-step guide to opening your Roth IRA?
How to Check if a Tuple Exists in a List in Python
Published Sep 12, 2021
∙ Updated May 2, 2022
Suppose we have a list of tuples in Python.
lst = [
(1, 2),
(4, 5),
(6, 4)
]
We want to check if a tuple (4, 5)
exists in our list lst
.
if (4, 5) in lst:
print('In the list')
else:
print('Not in the list')