Skip to content
Advertisement

Python Tkinter; Creating multiple labels without declaring each one individually. Is there a way to put this in a for loop?

To be more specific, I need to create 45 different labels that I can control the bg color of individually based on the user input. The project is a lottery, and each correct number the user gets needs to change it’s bg color.

JavaScript

Is there a much shorter way to write this like putting it in a for loop ?

Advertisement

Answer

Some few corrections to my code

JavaScript

The code above will create the labels to access the labels use.

JavaScript
Advertisement