import random def random_password(length): chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefjhijklmnopqrstuvwxyz1234567890-_=+)(*&^%$#@!~/><?}{" random_password = ''.join(random.choice(chars) for _ in range(length)) return random_password # Example print(random_password(8)) # Output: Jg8-P)#w