Answer
To create a label in Tkinter with the text "Welcome", a white foreground, and a red background, you can use the following code:
import tkinter as tk
root = tk.Tk()
welcome_label = tk.Label(root, text="Welcome", bg="red", fg="white")
welcome_label.pack()
root.mainloop()
Work Step by Step
In this code, 'root' is the main window of your Tkinter application, which is created using the 'Tk()' method. Then, we create a 'label' widget using the Label constructor and specify the parent window as 'root', the text as "Welcome", the background color as "red" using the 'bg' option, and the foreground color as "white" using the 'fg' option. Finally, we use the 'pack()' method to display the label on the screen.