I don't want the empty line to be printed in the output
I have tried end=""
but since print
is in loop
, it is not working
def main():
a=int(input())
b=int(input())
for i in range(a,b+1):
prime=0
for x in range(2,i):
if(i%x==0):
prime=prime+1
else:
prime=prime+0
if(prime==0):
print(i, end="")
main()
Actual result:
907
911
919
929
937
941
947
953
967
971
977
983
991
997
Expected:
907
911
919
929
937
941
947
953
967
971
977
983
991
997