Created
January 20, 2020 07:24
-
-
Save Allwin12/d9cc120949536d5e8e95e71ee363a32f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myArray = ['teststring1','strringrr','wow','strarirngr'] | |
letter = "r" | |
amount = 4 | |
filtered = [item for item in myArray if item.count(letter) == amount] | |
print(filtered) # ['strringrr', 'strarirngr'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment