Binary Triangle Pattern in Python #python3

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

nice trick (i+j), i tried to print it before watching you, and it took me many lines XD:
rows= 5
n = 1
for i in range(0, rows):
if i%2 ==0:
for j in range(0, n):
if j%2==0:
print(1, end="")
else:
print(0, end="")
else:
for j in range(0, n):
if j%2==0:
print(0, end="")
else:
print(1, end="")
n+=1
print()

Harun_kf
join shbcf.ru