Skip to content
Advertisement

Why there is space and p in last line in output?

a = "ns "
for i in  a:
    print(i,end = "pn")

this is the output Why there is space and p in last line in output ????

Advertisement

Answer

It is because your string contains a space and n is treated as a line break, leaving a p at the end of each line.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement