Jun-06-2020, 10:14 PM
Hi,
totaly new to this python stuff
I have 2 lists
i want to be able to randomly pick one item from each list one at a time
this code doesen't do the job
( for an example first i will get dog ,then hippo,then cat and etc)
thanks
totaly new to this python stuff
I have 2 lists
i want to be able to randomly pick one item from each list one at a time
this code doesen't do the job
( for an example first i will get dog ,then hippo,then cat and etc)

thanks
import tkinter as tk import random root=tk.Tk() def rand(): animalist1=['dog','cat','cow','horse','duck','bird'] animalist2 = ['Hippo', 'Bat', 'Fish', 'Whale', 'Bear', 'Monkey'] seqs = [animalist1,animalist2] animalrand1 = random.choice(random.choices(seqs, weights=map(len, seqs))[0]) #animalrand1 = random.choice(animalist1) #animalrand2 = random.choice(animalist2) label.configure(text=animalrand1) #label.configure(text=animalrand2)