I am solving the character pattern (Act 1) challenge in Python 3 on SPOJ. I am getting the output but it is not related to sample output.Please check my code for reference:
# your code goes here
n = int(input())
for i in range(n):
s,t = input().split()
s,t = int(s),int(t)
for i in range(s):
for j in range(t):
if (i+j) % 2 == 0:
print("*")
else:
print(".")
print("\n")
I got the following output:
*
.
*
*
.
*
.
.
*
.
*
*
.
*
.
.
*
.
*
*
.
*
.
*
.
*
.
*
.
but the correct output is:
*
.
*
*.*.
.*.*
*.*.
.*.*
*.*.*
.*.*.