[ create a new paste ] login | about

Link: http://codepad.org/WeFsVveg    [ raw code | output | fork ]

CarlFK - Python, pasted on Nov 8:
1
2
3
4
5
6
7
8
9
10
key_words={
 'state':'dead',
 'animal':'parrot',
}
partial_story = "It's a %(state)s %(animal)s."
full_story = partial_story % key_words
print full_story
for word in full_story.split():
    print word.upper(), len(word), 
    print [c for c in word if c.lower() in "aeiou"]


Output:
1
2
3
4
5
It's a dead parrot.
IT'S 4 ['I']
A 1 ['a']
DEAD 4 ['e', 'a']
PARROT. 7 ['a', 'o']


Create a new paste based on this one


Comments: