So lets say I'm playing Go Fish (that's totally what I'm coding btw), and I want to check for pairs with a function. There are a lot of brute force ways it could be done but the way that I think is possible that I'm not sure how to execute is to test for multiple occurrences of the same substring.
Example: Player_hand = ['Ace of Spades', 'Nine of Diamonds', 'Ace of Diamonds']
Now I was trying to use if Player_hand.find('Ace')==2
and that only tests for strings that are in their entirety 'Ace'
.
TLDR: I want to check if a substring appears multiple times in a list full of strings. Thanks for any help in advance!
EDIT: This question is not a duplicate of this question
Finding multiple occurrences of a string within a string in Python
This question shows how to find multiple occurrences within a single string, as well as how to find multiple occurrences of whole strings within a list. I am looking to find multiple occurrences of a substring within a list full of strings.