I put together this code which generates a string of 11 random printable ascii characters:
import random
foo=[]
for n in range(11):
foo.append(chr(random.randint(32,126)))
print "".join(foo)
It works fine, but I can't help feel that there might be a more efficient way than calling "append" 11 times. Any tips in making it more Pythonic?