Python code for this pattern.
1
0 1
0 1 0
1 0 1 0
1 0 1 0 1
Thank you :)
Answers
Answered by
10
Code:
k = 1
for i in range(0, 5 + 1):
for j in range(1, i + 1):
print("0" if k % 2 == 0 else "1", end="")
k += 1
print( )
Similar questions
n=int(input("Enter: "))
for i in range(n):
for j in range(i+1):
print(c%2,end=" ")
c+=1
print()