ninjacart interview question

Create a Password suggestion generator

Interview Answer

Anonymous

23 Sept 2024

import random import string def pwd_generator(length,use_num,use_spclchar): char+=string.ascii_letters if use_num: char+=string.digits if use_spclchar: char+=string.punctuation password=''join(random.choice(char) for _ in range(length()) retrun password pwd= pwd_generator(length=16,use_num=True,use_spclchar=True): print("the suggested cod eis ", pwd)