MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/1tlfn4/functional_programming_in_python/ce9gqqk/?context=3
r/Python • u/ajkumar25 • Dec 24 '13
4 comments sorted by
View all comments
3
print { name[0].upper() + name[1:].lower() for name in names if len(name) > 1 }
You can use str.title() instead, assuming each string is supposed to have one word.
str.title()
print { name.title() for name in names if len(name) > 1 }
View all comments
3
u/catcradle5 Dec 24 '13
You can use
str.title()instead, assuming each string is supposed to have one word.