Python:
from random import choices as ch
from math import log
p = input()
strength = lambda p:len(set(p))*log(ord(max(p))-ord(min(p))or 1)/log(2)
print('Your Password',end='')
if p.isdigit():
if 7<int(p)<33:
p = ''.join(ch([*map(chr,range(33,127))],k=int(p)))
print(f":\n{p}\nStrength: {strength(p):.2f} bits")
exit()
if len(p)>32 or len(p)<8: print(" must have between 8 and 32 characters !")
else: print(f":\n{p} \nhas a strength of {strength(p):.2f} bits")
Likes:
G30RG14N and Z3R0