How to find all words from a list that contains 2 specific letters in Python

1 Answer

0 votes
lst = ["python", "c", "c++", "c#", "java", "php", "nodejs", "ada", "go"]
 
for word in lst:
    if 'o' in word and 'n' in word:
        print(word)




'''
run:

python
nodejs

'''

 



answered Jun 21, 2024 by avibootz

Related questions

1 answer 145 views
1 answer 120 views
1 answer 101 views
1 answer 105 views
1 answer 162 views
...