Mosaic matrix: Difference between revisions
Content added Content deleted
No edit summary |
(→{{header|Python}}: Normalized whitespace from tabs to space * 4 in Calmosoft's draft. Corrected lang tag.) |
||
Line 465: | Line 465: | ||
=={{header|Python}}== |
=={{header|Python}}== |
||
<lang |
<lang python>size = 9 |
||
size = 9 |
|||
for Row in range(size): |
for Row in range(size): |
||
for Col in range(size): |
|||
if (Row % 2 == 1 and Col % 2 == 1) or (Row % 2 == 0 and Col % 2 == 0): |
|||
print("1", end=" ") |
|||
else: |
|||
print("0", end=" ") |
|||
print()</lang> |
|||
</lang> |
|||
Output: |
Output: |
||
<br> |
<br> |