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

Online now

Members online
491
Guests online
4,375
Total visitors
4,866

Forum statistics

Threads
2,349,192
Posts
29,361,080
Members
1,092,955
Latest member
chaseyui
Back
Top