Skip to content

Instantly share code, notes, and snippets.

@sgammon
Created May 18, 2013 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgammon/5605980 to your computer and use it in GitHub Desktop.
Save sgammon/5605980 to your computer and use it in GitHub Desktop.
# make our variables
vowels = ['a', 'e', 'i', 'o', 'u']
words = ['here', 'yup', 'nnn', 'bllble']
# empty results list that will contain tuples of (<word>, <vowel>) where `vowel` is `True` or `False`
results = []
for word in words:
for vowel in vowels:
if vowel in word:
results.append(word, True)
else:
results.append(word, False)
print results
>>> [('here', True), ('yup', True), ('nnn', False), ('bllble', False)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment