import random
lower = 'abcdefghijklmnopqrstuvexyz'
upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
numbers = '1234567890'
symbols = '[]@#&(),.!'
all = lower + upper + numbers + symbols
length = 8
# Prints elements of random items of given length
password = ''.join(random.sample(all, length))
print(password)... (More)