Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from random import *
- root = Tk()
- color = []
- for x in range(10):
- color.append(randint(0, 2))
- for x in range(10):
- if color[x] == 0:
- square = Label(text = '', bg = 'red', width = 2)
- elif color[x] == 1:
- square = Label(text = '', bg = 'blue', width = 2)
- else:
- square = Label(text = '', bg = 'green', width = 2)
- square.grid(row = 0, column = x)
- root.mainloop()
Add Comment
Please, Sign In to add comment