I'm trying to do an SPOJ problem and getting the number of test cases using:
tc = int(input())
However, I get a "non-zero exit code" error from that line when running my code. Here's the full code:
def is_on_edge(row, col, rows, cols):
is_top = row == 0
is_left = col == 0
is_right = (col == cols - 1)
is_bottom = (row == rows - 1)
return is_top or is_left or is_right or is_bottom
tc = int(input())
for i in range(tc):
rows, cols = map(int, input().split())
for r in rows:
for c in cols:
if is_on_edge(r, c, rows, cols):
print("*", end="")
else:
print(".", end="")
print("")
Any idea what I'm doing incorrectly?
Thanks!