This is the example list
greekAlpha = ["alpha", "beta", "gamma", "epsilon"]
CodePudding user response:
for word in greekAlpha:
if word.count(letter) > 0:
print(word)
CodePudding user response:
What about this?
for word in greekAlpha:
if 'a' in word:
print(word)
CodePudding user response:
This is One liner approach to condition
[word for word in greekAlpha if "a" in word]