I am trying to run this code without success. It is supposed to be a basic password generator that let you choose between generating a 20-characters one and a 8-char one.
Here is the code:
import random
def genpass():
    print('this is a password generator biiaatch!')
full_char_table = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"
alpha_char_table = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
scelta = input('choose a password: S = simple one/8 characters; D = difficult one/20 characters: ') 
x = 0
if scelta == "s" or "S":
    lenght = 8
    _type = alpha_char_table
    password = ""
        
    for x in range(int(lenght)):
        password = password + _type[int(random.randrange(len(_type)))]
        
        x += 1
    print('the password is: ' + password)    
elif scelta == "D" or "d":
    lenght2 = 20
    _type2 = full_char_table
    password2 = ""
        
    for x in range(int(lenght2)):
        password2 = password2 + _type2[int(random.randrange(len(_type2)))]
        
        x += 1
    print('the password is: ' + password2) 
It generates only the 8-chars one, even if I digit D or d or whatever. Does anybody know why it behaves like this?
 
     
     
     
    