Pattern Number & Stars-2

This is the error i get:
Traceback (most recent call last):
File “script.py”, line 1, in
n=int(input())
EOFError: EOF when reading a line

My code is:
n=int(input())
for i in range(1,n+1,1):
for j in range(1,n+1,1):
if j<=i:
print(j,end=’’)
else:
print("*",end=’’)
print()

i didn’t get what is wrong in this code

Hello Ankit, I tried running this it is working fine. Check the version of the python you are using.

 n=int(input())
 for i in range(1,n+1,1):
	for j in range(1,n+1,1):
		if j<=i:
			print(j,end='')
		else:
			print("*",end='')
	print()

It is the code pls check this also.
I hope it is clear to you so pls mark it as resolve and provide the rating/feedback so that we can improve ourselves and in case there is any issue pls let us know we will surely help you out.

Thanks :slight_smile:
Happy Coding !!

You can also check that the inverted commans are in correct format or not when you use it with end=’ ’