#Pattern Numbers & Stars - 1

#Pattern Numbers & Stars - 1

This is working fine in pycharm but not in the coding block compiler. Could you please help me with this.

#MySolution

star = 0

N = int(input())

for i in range(N):

for j in range(N - i):

    print(j + 1, end = '')

for k in range(star -  1):

    print("*", end='')

star = star + 2

if(i!=N): 

	print()

Hey @vi20083389, please share your code and screenshot of output in pycharm. Upload both the things on google drive and share the link over here. It is difficult to understand the code without proper indentation.

Thanks ! :+1:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Hi Aayush, Sorry for the late reply. Please find the attachment here. Code : https://drive.google.com/file/d/10TMV2s_IdzOvA38VH0iNvSRtuVaqLY72/view?usp=sharing and Screenshot of output : https://drive.google.com/file/d/1X19ltos1vC-MgGaDN8-m0P5CQlvalvQs/view?usp=sharing

Hey @vi20083389, not a problem. Always happy to help ! So I checked your code and it is very well written. Good work ! The reason test cases are failing is because you have to leave a space after you print any character. So just replace these lines of your code :

print(j + 1, end = '')
print("*", end='')
print('',end='\n')

by the following lines :

print(j + 1, end = ' ')
print("*", end=' ')
print(' ',end='\n')

I hope this clears your doubt ! :+1:
Please mark the doubt as resolved in your doubts section ! :slightly_smiling_face:
Happy coding ! :slight_smile: