password generator using random module (no function)
import random def passwordGen(length): chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@£$%^&*().,?0123456789' password = '' for i in range(length): password += random.choice(chars) return password print(passwordGen(int(input('password length? '))))