mercredi 4 septembre 2019

I want to chose an item randomly from a list but there is an error

I wanted to make a password generator but there is an error This is the part needed to recreate the error.

from random import *
Adj = ['Boring', 'Fun', 'Sleepy', 'Ultimate', 'Small', 'Big', 'Dumb']
Adjectives2 = random.choice(Adj)

It showed an AttributeError.

AttributeError:'builtin_function_or_method' object has no attribute 'choice'

I tried asking other's and they said the same thing. Use the 'random.choice()' function. They all were wrong.




Aucun commentaire:

Enregistrer un commentaire