🔒 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
  • 503
    Views
  • 2
    Participants
Last reply from:
zackmark29

Trending Topics

Online now

Members online
1,029
Guests online
3,305
Total visitors
4,334

Forum statistics

Threads
2,328,255
Posts
29,241,101
Members
1,159,645
Latest member
anh thuy
Back
Top