🔒 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.

Similar threads

About this Thread

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

Trending Topics

Online now

Members online
415
Guests online
1,836
Total visitors
2,251

Forum statistics

Threads
2,314,539
Posts
29,178,738
Members
1,184,188
Latest member
jose_juan_113
Back
Top