Feb-11-2021, 02:55 PM
(This post was last modified: Feb-11-2021, 03:31 PM by snippsat.
Edit Reason: Added code tag
)
Hi Team,
I am beginner in Python and below is my code. I want to print some content in specific format with below code but it is not printed as mention. it will be helpful if someone help to resolve it.
I am beginner in Python and below is my code. I want to print some content in specific format with below code but it is not printed as mention. it will be helpful if someone help to resolve it.
f = open(r"C:\Users\emanpos\bbuser.txt","r") for x in f: print("<Number>") print(" %s%s%s" %("<Number>", x,"</Number>")) print('</Number>')Expected Output:
Output:<Number>
<Number>abc</Number>
</Number>
But Output comes as below.Output:<Number>
<Number>abc
</Number>
</Number>