1 / 6
Aug 2018

I am solving the character pattern act 1 problem in python 3.I am getting the output like sample output but the pattern is not matching with that of the problem 's pattern.
Please check my code below.

> 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("*",end="")
> 			else:
> 				print(".",end="")
> 	print("\n")
  • created

    Aug '18
  • last reply

    Sep '18
  • 5

    replies

  • 1.7k

    views

  • 3

    users

  • 5

    links

You’re nearly there. Your problem is the print("\n"). That prints a newline, then adds another newline because there’s no end="".

Replace that print("\n") with

  	print()
  print()

(That’s two tab indentations for the first, and one indentation for the second.)

@Simes Thanks for your answer friend.I am very very thankful to you.Can you give me your contact number to stay in touch with me.

@spsk_1313
your code is bad pasted. It should be like this:

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("*",end="")
			else:
				print(".",end="")
	print("\n")

or you can use

How to use Ideone.com

like this: https://ideone.com/9dwL8R8


==
BTW
@spsk_1313
Maybe you want my contact number too? … and my bank account number, to stay in much better touch with me!? :wink:

18 days later