jeudi 28 septembre 2017

Python - choice() takes 2 positional arguments but 13 were given

import string


import random

def generator():

    password = ""

    passwordlength = random.randint(8,12)

    length = 0

    while length < passwordlength:
        password = password + random.choice(string.digits + string.ascii_letters + "!","$","%","^","&","*","(",")","-","_","=","+")

        length = len(password)

    print(password)

generator()

I have this code here but when I run it, it immediately comes up with the error "choice() takes 2 positional arguments but 13 were given". I am clueless as to what's a fault




Aucun commentaire:

Enregistrer un commentaire