ElenaSokol

Untitled

Oct 28th, 2021
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. n = int(input())
  2. a = 1
  3. b = 0
  4.  
  5. for row in range(1, n + 1):
  6.     for column in range(1, row + 1):
  7.         if row % 2 != 0:
  8.             first = a
  9.             second = b
  10.         else:
  11.             first = b
  12.             second = a
  13.         print(f'{first} {second}', end=' ')
  14.  
  15.     print()
  16.  
  17.  
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment