This is my code:
from tkinter import *
import random
root = Tk()
numbers = [0,1,2,3,4,5]
global AdviseBox
AdviseBox = Text(root, width=110, height=10)
AdviseBox.pack(side=RIGHT, expand=YES, padx=5, pady=5)
AdviseBox.insert(INSERT, "Your random number is:",(numbers[random.randint(0, len(numbers) - 1)]), "\n\nHappy?")
root.mainloop()
But I want it to produce this in the text box:
Your random number is: [RANDOM NUMBER HERE]
Happy?
I have tested to see if a print statement works instead of inserting the text into the textbox, and the print statement is able to produce the desired output. However, it seems the issue is the textbox not being able to understand the part where I pick a number form the list. I tried with other variables and it was the same issue. I don't know what to do, I think I have tried everything! :(
