Using two characters: . (dot) and * (asterisk) print a chessboard-like pattern. The first character printed should be * (asterisk).
Input
You are given t < 100 - the number of test cases and for each of the test cases two positive integers: l - the number of lines and c - the number of columns in the pattern (l, c < 100).
Output
For each of the test cases output the requested pattern (please have a look at the example). Use one line break in between successive patterns.
Example
Input: 3 3 1 4 4 2 5 Output: * . * *.*. .*.* *.*. .*.* *.*.* .*.*.代码如下:
t = int(input())
str='*.'
for i in range(t):
line = input();
l = int(line.split(' ')[0])
c = int(line.split(' ')[1])
for j in range(l):
for k in range(c):
print(str[int((j + k)%2)], sep='', end='')
print()