random.choice returns the same value

E

Erik Max Francis

Brian said:
Any reason why random.choice would return the first value in a list
everytime?

Because the list only has one element, or all the elements have the same
value?
 
B

Brian

Feel free to point and laugh. I guess it was getting a little too late.

I was doing something like this where ComedyList and SciFiList are
populated lists:

filelist = []

if var = "SciFi":
filelist = SciFiList
elif var = "Comedy":
filelist = ComedyList


I forgot to add the [:] at the end. I am the win.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top