Skip to content
Advertisement

How can I modify a label in tkinter?

I have been trying to figure out a way to modify the label to print element 1 to 4 in a line and repeat. I have attached a picture to hopefully clarify what I am trying to accomplish.

My goal is to make the results look like the following

1 A 2 B 3 C 4 D

1 a 2 b 3 c 4 d

enter image description here

JavaScript

Advertisement

Answer

You added n after each index/value pair. You need to add n after 4 index/value pairs instead:

JavaScript

Note that the for loop can be simplified as below:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement