Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # вторая программа
- from tkinter import *
- from random import *
- root = Tk()
- for i in range(10):
- for j in range(10):
- x = randint(1, 100)
- if x < 26:
- square = Label(text = str((i+1) * (j+1)), bg = 'blue', width = 4)
- elif x < 51:
- square = Label(text = str((i+1) * (j+1)), bg = 'lightblue', width = 4)
- elif x < 76:
- square = Label(text = str((i+1) * (j+1)), bg = 'yellow', width = 4)
- else:
- square = Label(text = str((i+1) * (j+1)), bg = 'orange', width = 4)
- square.grid(row = i, column = j)
- root.mainloop()
Add Comment
Please, Sign In to add comment