Jun-06-2020, 11:28 PM
in both cases I get more then one random choice
I think I worked it out with a simple if else statement
but thank you so much for your help
I think I worked it out with a simple if else statement
but thank you so much for your help
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'] animalrand1 = random.choice(animalist1) animalrand2 = random.choice(animalist2) if label.cget("text") in animalist1: label.configure(text=animalrand2) else: label.configure(text=animalrand1) #print (label.cget("text"))