I am trying to make a script that will generate a random string of text when i run it.
I have got far but im having a problem with formatting.
Here is the code im using
import random
alphabet = 'abcdefghijklmnopqrstuvwxyz'
min = 5
max = 15
name = random.sample(alphabet,random.randint(min,max))
print name
And when ever i end up with this
['i', 'c', 'x', 'n', 'y', 'b', 'g', 'r', 'h', 'p', 'w', 'o']
I am trying to format so it is one line of string so for example
['i', 'c', 'x', 'n', 'y', 'b', 'g', 'r', 'h', 'p', 'w', 'o'] = icxnybgrhpwo
sample
function always chooses a set of unique letters, so you'll run into a problem ifmax
is greater than 26 (ValueError: sample larger than population).