string - Python output not what i would think will happen (Functional Programming) -


i trying output vowel letters (case typed) of input , pipe thorugh python using "functional programming".

def bob(word):     return list(map(lambda x:x in ['a', 'e','i','o','u'], word.lower().strip()))  bob('hello') [false, true, false, false, true] 

although output seen above not expecting. ideas?

becuase of in comments got output looking for.

what worked me adding .lower() x in functional programming style using filter.

def bob(word):     return list(filter(lambda x:x.lower() in ['a','e','i','o','u'], word.strip())) 

this made output view upper case within aloha.

bob('aloha') ['a', 'o', 'a'] 

thanks guys!


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -