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

Online now

Members online
536
Guests online
2,854
Total visitors
3,390

Forum statistics

Threads
2,338,245
Posts
29,302,948
Members
1,126,132
Latest member
PokeWorldTrainer
Back
Top