๐Ÿ”’ Closed PHYTON LOOP

Status
Not open for further replies.
Python:
n = 6
for row in range(n + 1):
    for col in range(row):
        if (row + col) % 2 == 0:
            print('0', end=' ')
        else:
            print('1', end=' ')
    print()

Code:
1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
0 1 0 1 0 1
 
Status
Not open for further replies.

About this Thread

  • 1
    Replies
  • 516
    Views
  • 2
    Participants
Last reply from:
zackmark29

New Topics

Trending Topics

Online now

Members online
577
Guests online
11,616
Total visitors
12,193

Forum statistics

Threads
2,361,185
Posts
29,409,131
Members
1,060,224
Latest member
justanyfun
Back
Top