This code is giving a runtime error(nzec). Can anyone help?
# input the number of test cases
num = int(input())
# make a list
lst = []
#repeat for num times
for i in range(num):
#take a test case as input, it will be a string
string = input()
# convert the test cases into ints and append them into the lst
lst.append((int(string[0]), int(string[2])))
# print the pattern
for i in lst:
# this loop prints a line of the pattern
for j in range(i[0]):
if j%2 is 0:
for k in range(i[1]):
if k%2 is 0:
print('*', end='')
else:
print('.', end='')
print()
else:
for k in range(i[1]):
if k%2 is 0:
print('.', end='')
else:
print('*', end='')
print()
if not i is lst[len(lst) - 1]:
print()