mardi 4 octobre 2022

Why does print random just gives an error [closed]

from random import *

items =  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

print(random.choice(items))

Normally that works completely fine but i get that error:

Traceback (most recent call last):
  File "c:\Coding\Python\Projects\item_generator", line 6, in <module>       
    print(random.choice(items))
AttributeError: 'builtin_function_or_method' object has no attribute 'choice'



Aucun commentaire:

Enregistrer un commentaire