level: beginner
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
i want to know if word is entirely composed of letters in dict2
my approach:
step 1 : convert word to dictionary(dict1)
step2:
for k in dict1.keys():
if k in dict2:
if dict1[k] != dict2[k]:
Baba raoul...@gmail.com writes:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
i want to know if word is entirely composed of letters in dict2
set(word) = set(dict2.keys())
--
http://mail.python.org/mailman/listinfo/python-list
On 09/07/2010 12:46 PM, Baba wrote:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
Just go through each letter of word checking for its existence in
dict2. Return False if one misses, and True if you get through the
whole word:
def ...():
for c in word:
if c not
On 7 sep, 22:08, Gary Herron gher...@digipen.edu wrote:
On 09/07/2010 12:46 PM, Baba wrote:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
Just go through each letter of word checking for its existence in
dict2. Return False if one misses, and True if you get through the
On 07/09/2010 21:06, Paul Rubin wrote:
Babaraoul...@gmail.com writes:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
i want to know if word is entirely composed of letters in dict2
set(word)= set(dict2.keys())
Do the numbers in dict2 represent the maximum number of times
On Wed, Sep 8, 2010 at 1:56 AM, Baba raoul...@gmail.com wrote:
On 7 sep, 22:08, Gary Herron gher...@digipen.edu wrote:
On 09/07/2010 12:46 PM, Baba wrote:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
Just go through each letter of word checking for its existence in
Baba wrote:
On 7 sep, 22:08, Gary Herron gher...@digipen.edu wrote:
On 09/07/2010 12:46 PM, Baba wrote:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
Just go through each letter of word checking for its existence in
dict2. Return False if one misses, and True if you get
On 7 sep, 22:37, MRAB pyt...@mrabarnett.plus.com wrote:
On 07/09/2010 21:06, Paul Rubin wrote:
Babaraoul...@gmail.com writes:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
i want to know if word is entirely composed of letters in dict2
set(word)= set(dict2.keys())
Baba raoul...@gmail.com writes:
for k in word.keys():
if k not in hand:
return False
elif k in hand:
if word[k] hand[k]:
return False
return True
Untested:
all(word[k] = hand.get(k,0) for k in word)
On 09/07/2010 01:26 PM, Baba wrote:
On 7 sep, 22:08, Gary Herrongher...@digipen.edu wrote:
On 09/07/2010 12:46 PM, Baba wrote:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
Just go through each letter of word checking for its existence in
dict2. Return
On 07/09/2010 22:36, Baba wrote:
On 7 sep, 22:37, MRABpyt...@mrabarnett.plus.com wrote:
On 07/09/2010 21:06, Paul Rubin wrote:
Babaraoul...@gmail.comwrites:
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
i want to know if word is entirely composed of letters in dict2
On Tue, 7 Sep 2010 12:46:36 -0700 (PDT), Baba raoul...@gmail.com
wrote:
level: beginner
word= 'even'
dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2}
i want to know if word is entirely composed of letters in dict2
my approach:
step 1 : convert word to dictionary(dict1)
step2:
for k in
12 matches
Mail list logo