hi so im using python and i’m trying to create a function that lets me generate words made up of 2 letters. i also want to count how many of the words generated are actually in the dictionary.
this is what i have so far:
alphabet = ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o',
'p','q','r','s','t','u','v','w','x','y','z')
count1 = 0
text = " "
def find2LetterWords():
for letter in alphabet:
text += letter
for letter in alphabet:
text +=letter
print text
this is the code i have written so far and i know its not right. i was just experimenting. so yea it would be great if u could help me out. thx.
Answer edited based on comments:
If you want a nice one liner, with no function:
Obviously, replace
your_dictionarywith whatever the name of your dictionary is.