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

Trending Topics

Online now

Members online
354
Guests online
1,842
Total visitors
2,196

Forum statistics

Threads
2,291,628
Posts
29,071,890
Members
1,210,986
Latest member
rockybalboa3000
Back
Top