def alphanumeric_forever():
    """Yield a1, ..., z1, a2, ..., z2, ..."""
    cnt = 0
    while True:
        cnt += 1
        for l in string.lowercase():
            yield l + str(cnt)
예제 #2
0
import string

print "Enter the word or phrase you want to convert."
a = raw_input()
print "Do you want to capitalize, turn every character into lowercase, or turn every character into uppercase?"
b = raw_input()
if b == "capitalize":
    print string.capitalize(a)
if b == "turn every character into lowercase":
    print string.lowercase(a)
if b == "turn every character into uppercase":
    print string.upper(a)
def letters_forever():
    """Yield the letters of the alphabet, starting at a after every z"""
    while True:
        for l in string.lowercase():
            yield l