Number triangle - binary

 # Binary Triangles

"""

"""

# Read Number of lines 

N = int(input("Enter number of Lines : "))


print("Binary Triangle : ")


for n in range(1,N+1,1):

i = n%2

for val in range (1,n+1,1):

print(i, end=" ")

i=(i+1)%2

print()


No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu