Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- stro, row = map(int, input("y, x: ").split())
- mas = [[randint(0, 5) for j in range(row)]for i in range(stro)]
- ch = 0
- for i in range(stro):
- for j in range(row):
- print("{:^3}".format(mas[i][j]), end = "")
- print()
- print()
- for i in range(stro):
- for i in range(stro):
- for j in range(row):
- print("{:^3}".format(mas[i][j]), end = "")
- print()
- print()
- if ch == 1:
- ch = 0
- continue
- for j in range(row):
- if mas[i][j] == 0 and ch == 0:
- mas.insert(i - 1, mas[0])
- ch = 1
- stro += 1
- for i in range(stro):
- for j in range(row):
- print("{:^3}".format(mas[i][j]), end = "")
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement