Close
Close

\n in print

   Makhna

x=22

y=32

print(x\ny)

"This print statement is not working"


Answers

  •    tdgog

    print(x, "\n", y) or print(x, y, sep="\n")


    \n can only be used in a string:


    • If you wanted it to concatenate you could do print(str(x) + "\n" + str(y)
      - tdgog

Ask Yours
Post Yours
Write your answer