javanewbie javanewbie - 8 months ago 38
Python Question

Is there a random letter generator with a range?

I was wondering if there is a random letter generator in Python that takes a range as parameter?
For example, if I wanted a range between A and D? I know you can use this as a generator:

import random
import string


But it doesn't allow you to supply it a range.


You can slice string.ascii_letters: