def letters():
a = xrange(ord('a') , ord('z')+1)
B = xrange(ord('A') , ord('Z')+1)
while True:
yield chr(a)
yield chr(B)
Traceback (most recent call last):
File "<pyshell#225>" , line 1, in <module>
l.next()
File "<pyshell#223>" , line 5, in letters
yield chr(a)
TypeError: an integer is required
Any way to get around this?
a = xrange(ord('a') , ord('z')+1)
B = xrange(ord('A') , ord('Z')+1)
while True:
yield chr(a)
yield chr(B)
>>l = letters()
>>l.next()
>>l.next()
File "<pyshell#225>" , line 1, in <module>
l.next()
File "<pyshell#223>" , line 5, in letters
yield chr(a)
TypeError: an integer is required
>>>
Any way to get around this?
Comment