Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def printn(n):
- i = n
- if n == 0:
- c = 2
- else:
- c = 3
- while i > 0:
- c -= 1
- i //= 10
- print(' ' * c + str(n), end="")
- def rowprint(row, col):
- for i in range(row):
- if i % 2 == 0:
- for j in range(col):
- printn(j + i * col)
- else:
- for j in range(col - 1, -1, - 1):
- printn(j + i * col)
- print()
- row, col = map(int, input().split())
- rowprint(row, col)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement