I am trying to generate random number in python using random.sample . This is how I am writing code .
import random
r = "".join(random.sample("abcdefghijklmnopqrstuvwxyz", 10))
Above code generates random numbers of length 10 whose letters are populated from the letters a-z. How can i use regular expressions over there like [a-z]?
Just use this instead
If you want to generate digits you can use
range